File tree Expand file tree Collapse file tree 23 files changed +148
-145
lines changed Expand file tree Collapse file tree 23 files changed +148
-145
lines changed Original file line number Diff line number Diff line change 22 "strategy" : " semver" ,
33 "major" : 0 ,
44 "minor" : 7 ,
5- "patch" : 2 ,
5+ "patch" : 3 ,
66 "build" : 0
7- }
7+ }
Original file line number Diff line number Diff line change 1+ ## 0.7.3 2025-11-11
2+ * Converted to camelcase.
3+
14## 0.7.2 2025-11-06
25
36## 0.7.1 2025-11-06
Original file line number Diff line number Diff line change 1111
1212class Cache extends Singleton
1313{
14- private static array $ _Cache = [];
14+ private static array $ _cache = [];
1515
1616 /**
17- * @param string $Action
18- * @param string $Command
17+ * @param string $action
18+ * @param string $command
1919 * @return Cache
2020 */
2121
22- public function set ( string $ Action , string $ Command ): Cache
22+ public function set ( string $ action , string $ command ): Cache
2323 {
24- self ::$ _Cache [ $ Action ] = $ Command ;
24+ self ::$ _cache [ $ action ] = $ command ;
2525
2626 return self ::instance ();
2727 }
2828
2929 /**
30- * @param string $Action
30+ * @param string $action
3131 * @return ICommand
3232 * @throws CommandNotFound
3333 */
3434
35- public function get ( string $ Action ): ICommand
35+ public function get ( string $ action ): ICommand
3636 {
37- if ( !isset ( self ::$ _Cache [ $ Action ] ) )
37+ if ( !isset ( self ::$ _cache [ $ action ] ) )
3838 {
39- throw new CommandNotFound ( "No command found for action ' {$ Action }' in the cache. " );
39+ throw new CommandNotFound ( "No command found for action ' {$ action }' in the cache. " );
4040 }
4141
42- return new self::$ _Cache [ $ Action ];
42+ return new self::$ _cache [ $ action ];
4343 }
4444}
Original file line number Diff line number Diff line change 1010
1111class Factory
1212{
13- private Cache $ _Cache ;
13+ private Cache $ _cache ;
1414
1515 /**
16- * @param Cache $Cache
16+ * @param Cache $cache
1717 */
1818
19- public function __construct ( Cache $ Cache )
19+ public function __construct ( Cache $ cache )
2020 {
21- $ this ->_Cache = $ Cache ;
21+ $ this ->_cache = $ cache ;
2222 }
2323
2424 /**
25- * @param string $Action
25+ * @param string $action
2626 * @return ICommand
2727 * @throws CommandNotFound
2828 */
2929
30- public function get ( string $ Action ): ICommand
30+ public function get ( string $ action ): ICommand
3131 {
32- return $ this ->_Cache ->get ( $ Action );
32+ return $ this ->_cache ->get ( $ action );
3333 }
3434}
Original file line number Diff line number Diff line change 5858interface ICommand
5959{
6060 /**
61- * @param array|null $Params
61+ * @param array|null $params
6262 * @return mixed
6363 */
6464
65- public function execute ( ?array $ Params = null ): mixed ;
65+ public function execute ( ?array $ params = null ): mixed ;
6666}
Original file line number Diff line number Diff line change 5656class Invoker
5757{
5858 /**
59- * @param string $Action
60- * @param array|null $Params
59+ * @param string $action
60+ * @param array|null $params
6161 * @return mixed
6262 * @throws CommandNotFound
6363 * @throws EmptyActionParameter
6464 */
6565
66- public function process ( string $ Action , ?array $ Params = null ): mixed
66+ public function process ( string $ action , ?array $ params = null ): mixed
6767 {
68- if ( !$ Action )
68+ if ( !$ action )
6969 {
7070 throw new EmptyActionParameter (
7171 "Please pass 'Action:' parameter as first argument to Invoker::process() method "
7272 );
7373 }
7474
75- $ Factory = new Factory ( Cache::getInstance () );
76- $ Command = $ Factory ->get ( $ Action );
75+ $ factory = new Factory ( Cache::getInstance () );
76+ $ command = $ factory ->get ( $ action );
7777
78- return $ Command ->execute ($ Params );
78+ return $ command ->execute ($ params );
7979 }
8080}
Original file line number Diff line number Diff line change 1111class AndCriteria extends LogicBase implements ICriteria
1212{
1313 /**
14- * @param array $Entities
14+ * @param array $entities
1515 * @return array
1616 */
1717
18- public function meetCriteria ( array $ Entities )
18+ public function meetCriteria ( array $ entities )
1919 {
20- $ Result = $ this ->_Criteria ->meetCriteria ( $ Entities );
20+ $ result = $ this ->_criteria ->meetCriteria ( $ entities );
2121
22- if ( count ( $ Result ) == 0 )
22+ if ( count ( $ result ) == 0 )
2323 {
24- return $ Result ;
24+ return $ result ;
2525 }
2626
27- return $ this ->_OtherCriteria ->meetCriteria ( $ Result );
27+ return $ this ->_otherCriteria ->meetCriteria ( $ result );
2828 }
2929}
Original file line number Diff line number Diff line change 4646 */
4747abstract class Base implements ICriteria
4848{
49- protected $ _Criteria ;
49+ protected $ _criteria ;
5050
5151 /**
5252 * Creates an AND combination of this criteria with another criteria.
53- *
54- * @param ICriteria $OtherCriteria The criteria to combine with using AND logic
53+ *
54+ * @param ICriteria $otherCriteria The criteria to combine with using AND logic
5555 * @return AndCriteria A new criteria that represents this AND other
5656 */
57- public function _and ( ICriteria $ OtherCriteria )
57+ public function _and ( ICriteria $ otherCriteria )
5858 {
59- return new AndCriteria ( $ this , $ OtherCriteria );
59+ return new AndCriteria ( $ this , $ otherCriteria );
6060 }
6161
6262 /**
6363 * Creates an OR combination of this criteria with another criteria.
64- *
65- * @param ICriteria $OtherCriteria The criteria to combine with using OR logic
64+ *
65+ * @param ICriteria $otherCriteria The criteria to combine with using OR logic
6666 * @return OrCriteria A new criteria that represents this OR other
6767 */
68- public function _or ( ICriteria $ OtherCriteria )
68+ public function _or ( ICriteria $ otherCriteria )
6969 {
70- return new OrCriteria ( $ this , $ OtherCriteria );
70+ return new OrCriteria ( $ this , $ otherCriteria );
7171 }
7272
7373 /**
7474 * Creates a NOT (negation) of this criteria.
75- *
75+ *
7676 * @return NotCriteria A new criteria that represents the negation of this criteria
7777 */
7878 public function _not ()
Original file line number Diff line number Diff line change 5252interface ICriteria
5353{
5454 /**
55- * @param array $Entities
55+ * @param array $entities
5656 * @return array
5757 */
5858
59- public function meetCriteria ( array $ Entities );
59+ public function meetCriteria ( array $ entities );
6060}
Original file line number Diff line number Diff line change 44
55class KeyValue extends Base implements ICriteria
66{
7- private $ _Key ;
8- private $ _Value ;
7+ private $ _key ;
8+ private $ _value ;
99
10- public function __construct ( $ Key , $ Value )
10+ public function __construct ( $ key , $ value )
1111 {
12- $ this ->_Key = $ Key ;
13- $ this ->_Value = $ Value ;
12+ $ this ->_key = $ key ;
13+ $ this ->_value = $ value ;
1414 }
1515
16- public function meetCriteria ( array $ Entities )
16+ public function meetCriteria ( array $ entities )
1717 {
18- $ Results = [];
18+ $ results = [];
1919
20- foreach ( $ Entities as $ Item )
20+ foreach ( $ entities as $ item )
2121 {
22- if ( $ Item [ $ this ->_Key ] == $ this ->_Value )
22+ if ( $ item [ $ this ->_key ] == $ this ->_value )
2323 {
24- $ Results [] = $ Item ;
24+ $ results [] = $ item ;
2525 }
2626 }
2727
28- return $ Results ;
28+ return $ results ;
2929 }
3030}
You can’t perform that action at this time.
0 commit comments