Skip to content

Commit 2e8c6de

Browse files
committed
PHPstan leven 4
Signed-off-by: Jan Henckens <jan@henckens.be>
1 parent cefb511 commit 2e8c6de

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ includes:
22
- vendor/craftcms/phpstan/phpstan.neon
33

44
parameters:
5-
level: 3
5+
level: 4
66
paths:
77
- src

src/controllers/NodesController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ public function actionAddSlideOut()
249249
]);
250250

251251
if (!$node->validate()) {
252-
dd($node->getErrors());
253252
return $this->asFailure(Craft::t('navigate', 'Oops, something went wrong here'), $node->toArray());
254253
}
255254

src/extensions/NavigateExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getFunctions()
3535

3636
/**
3737
* @param $url
38-
* @param null $part
38+
* @param string|null $part
3939
* @return mixed
4040
*/
4141
public function parseUrl($url, $part = null)

src/services/NavigateService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function handleAddNavigation(ConfigEvent $event)
170170
public function saveNavigation(NavigationModel $model)
171171
{
172172
$record = false;
173-
if (isset($model->id)) {
173+
if ($model->id) {
174174
$record = NavigationRecord::findOne([
175175
'id' => $model->id,
176176
]);

src/services/NodesService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function getNodeTypes(NavigationModel $navigation)
263263

264264
public function deleteNode(NodeModel $node)
265265
{
266-
if (isset($node->id)) {
266+
if ($node->id) {
267267
if (NodeRecord::deleteAll([
268268
'id' => $node->id,
269269
])) {
@@ -283,7 +283,7 @@ public function save(NodeModel $node)
283283
{
284284
$isNew = !$node->id;
285285

286-
if (isset($node->id)) {
286+
if ($node->id) {
287287
$record = NodeRecord::findOne([
288288
'id' => $node->id,
289289
]);
@@ -324,7 +324,7 @@ public function move(NodeModel $node, $parent, $previousId)
324324
{
325325
/** @var NodeRecord $record */
326326
$record = NodeRecord::findOne(['id' => $node->id]);
327-
if (!$record) {
327+
if ($record === null) {
328328
return false;
329329
}
330330

src/variables/NavigateVariable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ class NavigateVariable
3131
// =========================================================================
3232
/**
3333
* @param $navHandle
34-
* @param null $siteId since 2.6.0
34+
* @param int|null $siteId since 2.6.0
3535
* @return mixed
3636
* @throws \craft\errors\SiteNotFoundException
3737
*/
3838
public function raw($navHandle, $siteId = null)
3939
{
40-
if ($siteId) {
40+
if ($siteId === null) {
4141
$site = Craft::$app->getSites()->getSiteById($siteId);
4242
if (!$site) {
4343
$siteId = Craft::$app->sites->getCurrentSite()->id;

0 commit comments

Comments
 (0)