Skip to content

Commit cc2e968

Browse files
committed
5.9.1 release
1 parent 39332c4 commit cc2e968

12 files changed

+255
-29
lines changed

docs/api/phalcon_annotations.md

+6
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ protected $data;
290290

291291
### Methods
292292

293+
```php
294+
public function __construct();
295+
```
296+
297+
298+
293299
```php
294300
public function read( string $key ): Reflection | bool;
295301
```

docs/api/phalcon_cli.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ Sets the default task suffix
362362

363363
- __Uses__
364364

365-
- `Phalcon\Cli\RouterInterface`
366365
- `Phalcon\Cli\Router\Exception`
367366
- `Phalcon\Cli\Router\Route`
368367
- `Phalcon\Cli\Router\RouteInterface`
@@ -548,13 +547,13 @@ Handles routing information received from command-line arguments
548547

549548

550549
```php
551-
public function setDefaultAction( string $actionName ): RouterInterface;
550+
public function setDefaultAction( string $actionName ): Router;
552551
```
553552
Sets the default action name
554553

555554

556555
```php
557-
public function setDefaultModule( string $moduleName ): RouterInterface;
556+
public function setDefaultModule( string $moduleName ): Router;
558557
```
559558
Sets the name of the default module
560559

@@ -566,7 +565,7 @@ Sets the default controller name
566565

567566

568567
```php
569-
public function setDefaults( array $defaults ): RouterInterface;
568+
public function setDefaults( array $defaults ): Router;
570569
```
571570
Sets an array of default paths. If a route is missing a path the router
572571
will use the defined here. This method must not be used to set a 404
@@ -1014,13 +1013,13 @@ Returns processed extra params
10141013

10151014

10161015
```php
1017-
public function getRouteById( mixed $id ): RouteInterface | bool;
1016+
public function getRouteById( mixed $id ): RouteInterface;
10181017
```
10191018
Returns a route object by its id
10201019

10211020

10221021
```php
1023-
public function getRouteByName( string $name ): RouteInterface | bool;
1022+
public function getRouteByName( string $name ): RouteInterface;
10241023
```
10251024
Returns a route object by its name
10261025

@@ -1044,13 +1043,13 @@ Handles routing information received from the rewrite engine
10441043

10451044

10461045
```php
1047-
public function setDefaultAction( string $actionName ): RouterInterface;
1046+
public function setDefaultAction( string $actionName ): void;
10481047
```
10491048
Sets the default action name
10501049

10511050

10521051
```php
1053-
public function setDefaultModule( string $moduleName ): RouterInterface;
1052+
public function setDefaultModule( string $moduleName ): void;
10541053
```
10551054
Sets the name of the default module
10561055

@@ -1062,7 +1061,7 @@ Sets the default task name
10621061

10631062

10641063
```php
1065-
public function setDefaults( array $defaults ): RouterInterface;
1064+
public function setDefaults( array $defaults ): void;
10661065
```
10671066
Sets an array of default paths
10681067

docs/api/phalcon_di.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ accessing a public property with the same name of a registered service
725725
@property \Phalcon\Mvc\Model\MetaData\Memory|\Phalcon\Mvc\Model\MetadataInterface $modelsMetadata
726726
@property \Phalcon\Mvc\Model\Transaction\Manager|\Phalcon\Mvc\Model\Transaction\ManagerInterface $transactionManager
727727
@property \Phalcon\Assets\Manager $assets
728-
@property \Phalcon\Di\Di|\Phalcon\Di\Di\DiInterface $di
728+
@property \Phalcon\Di\Di|\Phalcon\Di\DiInterface $di
729729
@property \Phalcon\Session\Bag|\Phalcon\Session\BagInterface $persistent
730730
@property \Phalcon\Mvc\View|\Phalcon\Mvc\ViewInterface $view
731731

docs/api/phalcon_dispatcher.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ hide:
2929
- `Phalcon\Filter\FilterInterface`
3030
- `Phalcon\Mvc\Model\Binder`
3131
- `Phalcon\Mvc\Model\BinderInterface`
32+
- `Phalcon\Support\Collection`
3233

3334
- __Extends__
3435

docs/api/phalcon_filter.md

+10
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,16 @@ $validator->add(
22232223
]
22242224
)
22252225
);
2226+
2227+
$validator->add(
2228+
2229+
new EmailValidator(
2230+
[
2231+
"message" => "The e-mail is not valid",
2232+
"allowUTF8" => true,
2233+
]
2234+
)
2235+
);
22262236
```
22272237

22282238

docs/api/phalcon_html.md

+192
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ This component offers an easy way to create breadcrumbs for your application.
154154
The resulting HTML when calling `render()` will have each breadcrumb enclosed
155155
in `<dt>` tags, while the whole string is enclosed in `<dl>` tags.
156156

157+
@deprecated Will be removed in future version
158+
Use {@see Phalcon\Html\Helper\Breadcrumbs} instead.
159+
157160

158161
### Properties
159162
```php
@@ -957,6 +960,193 @@ Produce a `<body>` tag.
957960

958961

959962

963+
## Html\Helper\Breadcrumbs
964+
965+
[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Breadcrumbs.zep)
966+
967+
968+
- __Namespace__
969+
970+
- `Phalcon\Html\Helper`
971+
972+
- __Uses__
973+
974+
- `Phalcon\Html\Escaper\EscaperInterface`
975+
- `Phalcon\Support\Helper\Str\Interpolate`
976+
977+
- __Extends__
978+
979+
`AbstractHelper`
980+
981+
- __Implements__
982+
983+
984+
This component offers an easy way to create breadcrumbs for your application.
985+
The resulting HTML when calling `render()` will have each breadcrumb enclosed
986+
in `<li>` tags, while the whole string is enclosed in `<nav>` and `<ol>` tags.
987+
988+
@phpstan-type TTemplate = array{
989+
main: string,
990+
line: string,
991+
last: string,
992+
}
993+
@phpstan-type TElement = array{
994+
attributes: array<string, string>,
995+
icon: string,
996+
link: string,
997+
text: string,
998+
}
999+
1000+
1001+
### Properties
1002+
```php
1003+
/**
1004+
* @var array<string, string>
1005+
*/
1006+
private $attributes;
1007+
1008+
/**
1009+
* Keeps all the breadcrumbs.
1010+
*
1011+
* @var array<int, TElement>
1012+
*/
1013+
private $data;
1014+
1015+
/**
1016+
* Crumb separator.
1017+
*
1018+
* @var string
1019+
*/
1020+
private $separator = <li>/</li>;
1021+
1022+
/**
1023+
* The HTML template to use to render the breadcrumbs.
1024+
*
1025+
* @var TTemplate
1026+
*/
1027+
private $template;
1028+
1029+
/**
1030+
* The HTML template to use to render the breadcrumbs.
1031+
*
1032+
* @var Interpolate
1033+
*/
1034+
private $interpolator;
1035+
1036+
```
1037+
1038+
### Methods
1039+
1040+
```php
1041+
public function __construct( EscaperInterface $escaper );
1042+
```
1043+
AbstractHelper constructor.
1044+
1045+
1046+
```php
1047+
public function __invoke( string $indent = string, string $delimiter = null ): Breadcrumbs;
1048+
```
1049+
Sets the indent and delimiter and returns the object back.
1050+
1051+
1052+
```php
1053+
public function add( string $text, string $link = string, string $icon = string, array $attributes = [] ): Breadcrumbs;
1054+
```
1055+
Adds a new crumb.
1056+
1057+
```php
1058+
// Adding a crumb with a link
1059+
$breadcrumbs->add("Home", "/");
1060+
1061+
// Adding a crumb with added attributes
1062+
$breadcrumbs->add("Home", "/", ["class" => "main"]);
1063+
1064+
// Adding a crumb without a link (normally the last one)
1065+
$breadcrumbs->add("Users");
1066+
```
1067+
1068+
1069+
```php
1070+
public function clear(): void;
1071+
```
1072+
Clears the crumbs.
1073+
1074+
```php
1075+
$breadcrumbs->clear()
1076+
```
1077+
1078+
1079+
```php
1080+
public function clearAttributes(): Breadcrumbs;
1081+
```
1082+
Clear the attributes of the parent element.
1083+
1084+
1085+
```php
1086+
public function getAttributes(): array;
1087+
```
1088+
Get the attributes of the parent element.
1089+
1090+
1091+
```php
1092+
public function getSeparator(): string;
1093+
```
1094+
Returns the separator.
1095+
1096+
1097+
```php
1098+
public function getTemplate(): array;
1099+
```
1100+
Return the current template.
1101+
1102+
1103+
```php
1104+
public function remove( int $index ): void;
1105+
```
1106+
Removes crumb by url.
1107+
1108+
```php
1109+
// Remove the second element
1110+
$breadcrumbs->remove(2);
1111+
```
1112+
1113+
1114+
```php
1115+
public function render(): string;
1116+
```
1117+
Renders and outputs breadcrumbs based on previously set template.
1118+
1119+
```php
1120+
echo $breadcrumbs->render();
1121+
```
1122+
1123+
1124+
```php
1125+
public function setAttributes( array $attributes ): Breadcrumbs;
1126+
```
1127+
Set the attributes for the parent element.
1128+
1129+
1130+
```php
1131+
public function setSeparator( string $separator ): Breadcrumbs;
1132+
```
1133+
Set the separator.
1134+
1135+
1136+
```php
1137+
public function setTemplate( string $main, string $line, string $last ): Breadcrumbs;
1138+
```
1139+
Set the HTML template.
1140+
1141+
1142+
```php
1143+
public function toArray(): array;
1144+
```
1145+
Returns the internal breadcrumbs array.
1146+
1147+
1148+
1149+
9601150
## Html\Helper\Button
9611151

9621152
[Source on GitHub](https://github.com/phalcon/cphalcon/blob/5.0.x/phalcon/Html/Helper/Button.zep)
@@ -3235,6 +3425,7 @@ Serializer method
32353425

32363426
- `Phalcon\Factory\AbstractFactory`
32373427
- `Phalcon\Html\Escaper\EscaperInterface`
3428+
- `Phalcon\Html\Helper\Breadcrumbs`
32383429
- `Phalcon\Html\Helper\Doctype`
32393430
- `Phalcon\Html\Helper\Input\Checkbox`
32403431
- `Phalcon\Html\Helper\Input\Color`
@@ -3288,6 +3479,7 @@ The class implements `__call()` to allow calling helper objects as methods.
32883479

32893480
@method string a(string $href, string $text, array $attributes = [], bool $raw = false)
32903481
@method string base(string $href, array $attributes = [])
3482+
@method Breadcrumbs breadcrumbs(string $indent = ' ', string $delimiter = "\n")
32913483
@method string body(array $attributes = [])
32923484
@method string button(string $text, array $attributes = [], bool $raw = false)
32933485
@method string close(string $tag, bool $raw = false)

0 commit comments

Comments
 (0)