Skip to content

Commit

Permalink
Updated from gen-doc and cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Quadling authored and Richard Quadling committed Mar 14, 2017
1 parent 4f34c40 commit 3ee3bc4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Assertion::null(mixed $value);
Assertion::numeric(mixed $value);
Assertion::objectOrClass(mixed $value);
Assertion::phpVersion(string $operator, mixed $version);
Assertion::propertiesExist(mixed $value, mixed $properties);
Assertion::propertiesExist(mixed $value, array $properties);
Assertion::propertyExists(mixed $value, string $property);
Assertion::range(mixed $value, mixed $minValue, mixed $maxValue);
Assertion::readable(string $value);
Expand Down
16 changes: 8 additions & 8 deletions lib/Assert/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
* @method static bool allNumeric(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric for all values.
* @method static bool allObjectOrClass(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists for all values.
* @method static bool allPhpVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version for all values.
* @method static bool allPropertiesExist(mixed $value, mixed $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist for all values.
* @method static bool allPropertiesExist(mixed $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist for all values.
* @method static bool allPropertyExists(mixed $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists for all values.
* @method static bool allRange(mixed $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers for all values.
* @method static bool allReadable(string $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable for all values.
Expand Down Expand Up @@ -165,7 +165,7 @@
* @method static bool nullOrNumeric(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that value is numeric or that the value is null.
* @method static bool nullOrObjectOrClass(mixed $value, string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists or that the value is null.
* @method static bool nullOrPhpVersion(string $operator, mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version or that the value is null.
* @method static bool nullOrPropertiesExist(mixed $value, mixed $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist or that the value is null.
* @method static bool nullOrPropertiesExist(mixed $value, array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist or that the value is null.
* @method static bool nullOrPropertyExists(mixed $value, string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists or that the value is null.
* @method static bool nullOrRange(mixed $value, mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers or that the value is null.
* @method static bool nullOrReadable(string $value, string|callable $message = null, string $propertyPath = null) Assert that the value is something readable or that the value is null.
Expand Down Expand Up @@ -2193,7 +2193,7 @@ public static function date($value, $format, $message = null, $propertyPath = nu
*/
public static function objectOrClass($value, $message = null, $propertyPath = null)
{
if (!is_object($value)) {
if (!\is_object($value)) {
static::classExists($value, $message, $propertyPath);
}

Expand All @@ -2216,8 +2216,8 @@ public static function propertyExists($value, $property, $message = null, $prope
{
static::objectOrClass($value);

if (!property_exists($value, $property)) {
$message = sprintf(
if (!\property_exists($value, $property)) {
$message = \sprintf(
static::generateMessage($message) ?: 'Class "%s" does not have property "%s".',
static::stringify($value),
static::stringify($property)
Expand Down Expand Up @@ -2247,15 +2247,15 @@ public static function propertiesExist($value, array $properties, $message = nul

$invalidProperties = array();
foreach ($properties as $property) {
if (!property_exists($value, $property)) {
if (!\property_exists($value, $property)) {
$invalidProperties[] = $property;
}

if ($invalidProperties) {
$message = sprintf(
$message = \sprintf(
static::generateMessage($message) ?: 'Class "%s" does not have these properties: %s.',
static::stringify($value),
static::stringify(implode(', ', $invalidProperties))
static::stringify(\implode(', ', $invalidProperties))
);

throw static::createException($value, $message, static::INVALID_PROPERTY, $propertyPath);
Expand Down
2 changes: 1 addition & 1 deletion lib/Assert/AssertionChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
* @method AssertionChain numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric.
* @method AssertionChain objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists.
* @method AssertionChain phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version.
* @method AssertionChain propertiesExist(mixed $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
* @method AssertionChain propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
* @method AssertionChain propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists.
* @method AssertionChain range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers.
* @method AssertionChain readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable.
Expand Down
2 changes: 1 addition & 1 deletion lib/Assert/LazyAssertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
* @method LazyAssertion numeric(string|callable $message = null, string $propertyPath = null) Assert that value is numeric.
* @method LazyAssertion objectOrClass(string|callable $message = null, string $propertyPath = null) Assert that the value is an object, or a class that exists.
* @method LazyAssertion phpVersion(mixed $version, string|callable $message = null, string $propertyPath = null) Assert on PHP version.
* @method LazyAssertion propertiesExist(mixed $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
* @method LazyAssertion propertiesExist(array $properties, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the properties all exist.
* @method LazyAssertion propertyExists(string $property, string|callable $message = null, string $propertyPath = null) Assert that the value is an object or class, and that the property exists.
* @method LazyAssertion range(mixed $minValue, mixed $maxValue, string|callable $message = null, string $propertyPath = null) Assert that value is in range of numbers.
* @method LazyAssertion readable(string|callable $message = null, string $propertyPath = null) Assert that the value is something readable.
Expand Down

0 comments on commit 3ee3bc4

Please sign in to comment.