1. Go to this page and download the library: Download atomino/util-attr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
class MyAttr extends \Atomino\Neutrons\Attr
{
public function __construct(public string $name){...}
}
#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD)]
class MyRepeatableAttr extends \Atomino\Neutrons\Attr
{
public function __construct(public string $name){...}
}
#[MyAttr("my awesome class")]
#[MyRepeatableAttr("my awesome class")]
class MyClass
{
#[MyAttr("my awesome method")]
#[MyRepeatableAttr("my awesome method")]
#[MyRepeatableAttr("my awesome method two")]
public function myMethod(){...}
}