diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 327f3da4f..71adc1588 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -6,7 +6,7 @@
-
+
@@ -38,8 +38,6 @@
-
-
@@ -56,6 +54,10 @@
+
+
+ 0
+
@@ -82,10 +84,18 @@
+
+
+ 0
+
0
+
+
+ warning
+
diff --git a/src/Charcoal/Admin/Action/ElfinderConnectorAction.php b/src/Charcoal/Admin/Action/ElfinderConnectorAction.php
index 0984f70df..c3a1d8fb5 100644
--- a/src/Charcoal/Admin/Action/ElfinderConnectorAction.php
+++ b/src/Charcoal/Admin/Action/ElfinderConnectorAction.php
@@ -560,12 +560,12 @@ protected function resolveCallbacksForBindOption(array $toResolve)
*
* @todo Move this method to a dedicated plugin class.
*
- * @param string $cmd The command name.
- * @param array $result The command result.
- * @param array $args The command arguments from the client.
- * @param object $elfinder The elFinder instance.
- * @param object $volume The current volume instance.
- * @return void|bool|array
+ * @param string $cmd The command name.
+ * @param mixed $result The command result.
+ * @param mixed $args The command arguments from the client.
+ * @param object $elfinder The elFinder instance.
+ * @param object $volume The current volume instance.
+ * @return void|boolean|array
*/
public function translateDirectoriesOnAnyCommand($cmd, &$result, $args, $elfinder, $volume)
{
@@ -690,7 +690,7 @@ protected function translateFilesystemName(string $ident): ?string
* @param string $src The temporary file name.
* @param object $elfinder The elFinder instance.
* @param object $volume The current volume instance.
- * @return void|bool|array
+ * @return void|boolean|array
*/
public function sanitizeOnUploadPreSave(&$path, &$name, $src, $elfinder, $volume)
{
diff --git a/src/Charcoal/Admin/Property/AbstractProperty.php b/src/Charcoal/Admin/Property/AbstractProperty.php
index 5530888a2..dc4e7c2d0 100644
--- a/src/Charcoal/Admin/Property/AbstractProperty.php
+++ b/src/Charcoal/Admin/Property/AbstractProperty.php
@@ -294,8 +294,8 @@ public function ident()
* If a valid "function" option is not passed,
* this method does nothing.
*
- * @param string $val The value to escape.
- * @param array $options Optional escape options.
+ * @param string $val The value to escape.
+ * @param array $options Optional escape options.
* @throws InvalidArgumentException If the value to escape is not a string.
* @return string
*/
diff --git a/src/Charcoal/Admin/Property/AbstractPropertyDisplay.php b/src/Charcoal/Admin/Property/AbstractPropertyDisplay.php
index 290877598..a74c1c3ca 100644
--- a/src/Charcoal/Admin/Property/AbstractPropertyDisplay.php
+++ b/src/Charcoal/Admin/Property/AbstractPropertyDisplay.php
@@ -258,7 +258,7 @@ public function setDisplayEscape($escape)
*/
public function getDisplayEscape()
{
- return $this->getDisplayEscapeOptions()['function'] ?? null;
+ return ($this->getDisplayEscapeOptions()['function'] ?? null);
}
/**
@@ -288,8 +288,8 @@ public function getDisplayEscapeOptions()
/**
* Escapes the given value according to display escape options.
*
- * @param string $val The value to escape.
- * @param array $options Optional escape options.
+ * @param string $val The value to escape.
+ * @param array $options Optional escape options.
* @throws InvalidArgumentException If the value to escape is not a string.
* @return string
*/
@@ -328,6 +328,7 @@ public function escapeVal($val, array $options = [])
}
/**
+ * @throws UnexpectedValueException If the value is not a scalar.
* @return string
*/
public function displayVal()
diff --git a/src/Charcoal/Admin/Property/AbstractPropertyInput.php b/src/Charcoal/Admin/Property/AbstractPropertyInput.php
index 0e013fb24..6185497df 100644
--- a/src/Charcoal/Admin/Property/AbstractPropertyInput.php
+++ b/src/Charcoal/Admin/Property/AbstractPropertyInput.php
@@ -310,7 +310,7 @@ public function setInputEscape($escape)
*/
public function getInputEscape()
{
- return $this->getInputEscapeOptions()['function'] ?? null;
+ return ($this->getInputEscapeOptions()['function'] ?? null);
}
/**
@@ -340,8 +340,8 @@ public function getInputEscapeOptions()
/**
* Escapes the given value according to input escape options.
*
- * @param string $val The value to escape.
- * @param array $options Optional escape options.
+ * @param string $val The value to escape.
+ * @param array $options Optional escape options.
* @throws InvalidArgumentException If the value to escape is not a string.
* @return string
*/
@@ -508,7 +508,7 @@ public function inputPrefix()
}
}
- return $this->inputPrefix ?? null;
+ return ($this->inputPrefix ?? null);
}
/**
@@ -559,7 +559,7 @@ public function inputSuffix()
}
}
- return $this->inputSuffix ?? null;
+ return ($this->inputSuffix ?? null);
}
/**
@@ -655,7 +655,7 @@ public function setPlaceholder($placeholder)
}
/**
- * @return bool
+ * @return boolean
*/
public function hasPlaceholder()
{
@@ -687,7 +687,7 @@ public function placeholder()
}
}
- return $this->placeholder ?? null;
+ return ($this->placeholder ?? null);
}
/**
diff --git a/src/Charcoal/Admin/Property/Display/MessageDisplay.php b/src/Charcoal/Admin/Property/Display/MessageDisplay.php
index 64f0c9489..a0b827eb7 100644
--- a/src/Charcoal/Admin/Property/Display/MessageDisplay.php
+++ b/src/Charcoal/Admin/Property/Display/MessageDisplay.php
@@ -60,7 +60,7 @@ public function setMessage($message)
}
/**
- * @return bool
+ * @return boolean
*/
public function hasMessage()
{
diff --git a/src/Charcoal/Admin/Property/Input/ReadonlyInput.php b/src/Charcoal/Admin/Property/Input/ReadonlyInput.php
index c8df381a0..9e9d62403 100644
--- a/src/Charcoal/Admin/Property/Input/ReadonlyInput.php
+++ b/src/Charcoal/Admin/Property/Input/ReadonlyInput.php
@@ -224,7 +224,7 @@ public function maybeUnserializeValue($input)
{
if (!is_null($input) && $this->maybeInputIsSerialized()) {
try {
- $output = json_decode($input, false, 512, JSON_THROW_ON_ERROR);
+ $output = json_decode($input, false, 512, JSON_THROW_ON_ERROR);
if (!is_scalar($output) && !is_null($output)) {
return $output;
}
diff --git a/src/Charcoal/Admin/Support/Sorter.php b/src/Charcoal/Admin/Support/Sorter.php
index abd8e558a..c8c172b0d 100644
--- a/src/Charcoal/Admin/Support/Sorter.php
+++ b/src/Charcoal/Admin/Support/Sorter.php
@@ -10,7 +10,7 @@ class Sorter
/**
* Compares the priority attribute of two array-accessible variables
* to determine if the first variable is considered to be respectively
- * less than, equal to, or greater than the second.
+ * less than, equal to, or greater than the second.
*
* To be called with {@see uasort()}.
*
diff --git a/src/Charcoal/Admin/Ui/HasLanguageSwitcherTrait.php b/src/Charcoal/Admin/Ui/HasLanguageSwitcherTrait.php
index 7a2f86b0a..306486894 100644
--- a/src/Charcoal/Admin/Ui/HasLanguageSwitcherTrait.php
+++ b/src/Charcoal/Admin/Ui/HasLanguageSwitcherTrait.php
@@ -70,7 +70,7 @@ public function languages()
/**
* Resolves whether to display the language switcher or not.
*
- * @var boolean
+ * @return boolean
*/
abstract protected function resolveShowLanguageSwitch();
}
diff --git a/src/Charcoal/Admin/Ui/LanguageSwitcherAwareInterface.php b/src/Charcoal/Admin/Ui/LanguageSwitcherAwareInterface.php
index 17878deb2..88a9d3c1d 100644
--- a/src/Charcoal/Admin/Ui/LanguageSwitcherAwareInterface.php
+++ b/src/Charcoal/Admin/Ui/LanguageSwitcherAwareInterface.php
@@ -13,7 +13,7 @@ interface LanguageSwitcherAwareInterface
/**
* Whether a language switcher could be displayed.
*
- * @return bool
+ * @return boolean
*/
public function supportsLanguageSwitch(): bool;
}
diff --git a/src/Charcoal/Admin/Widget/FormWidget.php b/src/Charcoal/Admin/Widget/FormWidget.php
index fbdc18566..8b26270a1 100644
--- a/src/Charcoal/Admin/Widget/FormWidget.php
+++ b/src/Charcoal/Admin/Widget/FormWidget.php
@@ -392,7 +392,7 @@ public function addSidebar($sidebarIdent, $sidebar)
*/
public function hasSidebars()
{
- return (bool) $this->sidebars;
+ return (bool)$this->sidebars;
}
/**
@@ -617,7 +617,7 @@ public function hiddenProperties()
/**
* Whether a language switcher could be displayed.
*
- * @return bool
+ * @return boolean
*/
public function supportsLanguageSwitch(): bool
{
diff --git a/src/Charcoal/Admin/Widget/ObjectFormWidget.php b/src/Charcoal/Admin/Widget/ObjectFormWidget.php
index 1564212ae..a0d84fe96 100644
--- a/src/Charcoal/Admin/Widget/ObjectFormWidget.php
+++ b/src/Charcoal/Admin/Widget/ObjectFormWidget.php
@@ -573,7 +573,7 @@ protected function dataFromObject()
/**
* Whether a language switcher could be displayed.
*
- * @return bool
+ * @return boolean
*/
public function supportsLanguageSwitch(): bool
{
@@ -624,7 +624,7 @@ public function hasL10nFormProperties()
* Determine if the group has any multilingual properties.
*
* @param FormGroupInterface $group
- * @return bool
+ * @return boolean
*/
protected function hasL10nGroupProperties(FormGroupInterface $group)
{
diff --git a/tests/Charcoal/Admin/Widget/GraphWidgetTest.php b/tests/Charcoal/Admin/Widget/GraphWidgetTest.php
index 1df71f479..0e6eaf9cb 100644
--- a/tests/Charcoal/Admin/Widget/GraphWidgetTest.php
+++ b/tests/Charcoal/Admin/Widget/GraphWidgetTest.php
@@ -32,11 +32,11 @@ public function testSetData()
{
$obj = $this->obj;
$ret = $obj->setData([
- 'height'=>222,
- 'colors'=>['#ff0000', '#0000ff']
+ 'height' => 222,
+ 'colors' => ['#ff0000', '#0000ff']
]);
$this->assertSame($obj, $ret);
- $this->assertEquals(222, $obj->height());
+ $this->assertEquals('222px', $obj->height());
$this->assertEquals(['#ff0000', '#0000ff'], $obj->colors());
}
@@ -46,11 +46,11 @@ public function testSetData()
public function testSetHeight()
{
$obj = $this->obj;
- $this->assertEquals(400, $obj->height());
+ $this->assertEquals('400px', $obj->height());
$ret = $obj->setHeight(333);
$this->assertSame($obj, $ret);
- $this->assertEquals(333, $obj->height());
+ $this->assertEquals('333px', $obj->height());
//$this->expectException('\InvalidArgumentException');
//$obj->setHeight(false);