-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #572 from jolicode/examples
Rework our examples
- Loading branch information
Showing
19 changed files
with
71 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
// Play with configuration and namespaces | ||
|
||
namespace configuration\foo; | ||
|
||
use Castor\Attribute\AsTask; | ||
|
||
use function Castor\io; | ||
|
||
#[AsTask(description: 'Prints foo')] | ||
function foo(): void | ||
{ | ||
io()->writeln('foo'); | ||
} | ||
|
||
namespace configuration\bar; | ||
|
||
use Castor\Attribute\AsTask; | ||
|
||
use function Castor\io; | ||
use function configuration\foo\foo; | ||
|
||
#[AsTask(description: 'Prints bar, but also executes foo')] | ||
function bar(): void | ||
{ | ||
foo(); | ||
|
||
io()->writeln('bar'); | ||
} | ||
|
||
namespace configuration\rename; | ||
|
||
use Castor\Attribute\AsTask; | ||
|
||
use function Castor\io; | ||
|
||
#[AsTask(name: 'renamed', namespace: 'configuration', description: 'Task that was renamed')] | ||
function a_very_long_function_name_that_is_very_painful_to_write(): void | ||
{ | ||
io()->writeln('Foo bar'); | ||
} | ||
|
||
#[AsTask(name: 'no-namespace', namespace: '', description: 'Task without a namespace')] | ||
function no_namespace(): void | ||
{ | ||
io()->writeln('renamed'); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Number of PHP files: 34 | ||
Number of PHP files: 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters