diff --git a/.github/workflows/pint-fix.yml b/.github/workflows/pint-fix.yml new file mode 100644 index 0000000000..63b0f3e3d8 --- /dev/null +++ b/.github/workflows/pint-fix.yml @@ -0,0 +1,28 @@ +name: Fix PHP code style issues + +on: + push: + paths: + - '**.php' + +permissions: + contents: write + +jobs: + fix-php-code-styling: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.PINT }} + + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@1.0.0 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling diff --git a/.github/workflows/pint-lint.yml b/.github/workflows/pint-lint.yml new file mode 100644 index 0000000000..87a91b0e6d --- /dev/null +++ b/.github/workflows/pint-lint.yml @@ -0,0 +1,20 @@ +name: Lint PHP code style issues + +on: + pull_request: + paths: + - '**.php' + +jobs: + lint-php-code-styling: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check PHP code style issues + uses: aglipanci/laravel-pint-action@1.0.0 + with: + testMode: true + verboseMode: true diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 02396b6b61..0000000000 --- a/.styleci.yml +++ /dev/null @@ -1,2 +0,0 @@ -preset: laravel -risky: false diff --git a/pint.json b/pint.json index 7f10dcb568..ce1bb7fead 100644 --- a/pint.json +++ b/pint.json @@ -1,21 +1,11 @@ { "preset": "laravel", "rules": { - "binary_operator_spaces": { - "default": "single_space", - "operators": { - "=>": null - } - }, "class_attributes_separation": { "elements": { "method": "one" } }, - "class_definition": { - "multi_line_extends_each_single_line": true, - "single_item_single_line": true - }, "psr_autoloading": true } } diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index c9c41f278e..52d5aa21d3 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -13,108 +13,108 @@ | */ - 'accepted' => 'Must be accepted.', - 'active_url' => 'This is not a valid URL.', - 'after' => 'Must be a date after :date.', - 'after_or_equal' => 'Must be a date after or equal to :date.', - 'alpha' => 'May only contain letters.', - 'alpha_dash' => 'May only contain letters, numbers, dashes and underscores.', - 'alpha_num' => 'May only contain letters and numbers.', - 'array' => 'Must be an array.', - 'before' => 'Must be a date before :date.', - 'before_or_equal' => 'Must be a date before or equal to :date.', - 'between' => [ + 'accepted' => 'Must be accepted.', + 'active_url' => 'This is not a valid URL.', + 'after' => 'Must be a date after :date.', + 'after_or_equal' => 'Must be a date after or equal to :date.', + 'alpha' => 'May only contain letters.', + 'alpha_dash' => 'May only contain letters, numbers, dashes and underscores.', + 'alpha_num' => 'May only contain letters and numbers.', + 'array' => 'Must be an array.', + 'before' => 'Must be a date before :date.', + 'before_or_equal' => 'Must be a date before or equal to :date.', + 'between' => [ 'numeric' => 'Must be between :min and :max.', - 'file' => 'Must be between :min and :max kilobytes.', - 'string' => 'Must be between :min and :max characters.', - 'array' => 'Must have between :min and :max items.', + 'file' => 'Must be between :min and :max kilobytes.', + 'string' => 'Must be between :min and :max characters.', + 'array' => 'Must have between :min and :max items.', ], - 'boolean' => 'Must be true or false.', - 'confirmed' => 'Confirmation does not match.', - 'current_password' => 'The password is incorrect.', - 'date' => 'Not a valid date.', - 'date_format' => 'Does not match the format :format.', - 'different' => 'This field and :other must be different.', - 'digits' => 'Must be :digits digits.', - 'digits_between' => 'Must be between :min and :max digits.', - 'dimensions' => 'Invalid image dimensions.', - 'distinct' => 'This field has a duplicate value.', - 'email' => 'Must be a valid email address.', - 'ends_with' => 'Must end with :values', - 'exists' => 'This is invalid.', - 'file' => 'Must be a file.', - 'filled' => 'Must have a value.', - 'gt' => [ + 'boolean' => 'Must be true or false.', + 'confirmed' => 'Confirmation does not match.', + 'current_password' => 'The password is incorrect.', + 'date' => 'Not a valid date.', + 'date_format' => 'Does not match the format :format.', + 'different' => 'This field and :other must be different.', + 'digits' => 'Must be :digits digits.', + 'digits_between' => 'Must be between :min and :max digits.', + 'dimensions' => 'Invalid image dimensions.', + 'distinct' => 'This field has a duplicate value.', + 'email' => 'Must be a valid email address.', + 'ends_with' => 'Must end with :values', + 'exists' => 'This is invalid.', + 'file' => 'Must be a file.', + 'filled' => 'Must have a value.', + 'gt' => [ 'numeric' => 'Must be greater than :value.', - 'file' => 'Must be greater than :value kilobytes.', - 'string' => 'Must be greater than :value characters.', - 'array' => 'Must have more than :value items.', + 'file' => 'Must be greater than :value kilobytes.', + 'string' => 'Must be greater than :value characters.', + 'array' => 'Must have more than :value items.', ], - 'gte' => [ + 'gte' => [ 'numeric' => 'Must be greater than or equal :value.', - 'file' => 'Must be greater than or equal :value kilobytes.', - 'string' => 'Must be greater than or equal :value characters.', - 'array' => 'Must have :value items or more.', + 'file' => 'Must be greater than or equal :value kilobytes.', + 'string' => 'Must be greater than or equal :value characters.', + 'array' => 'Must have :value items or more.', ], - 'image' => 'Must be an image.', - 'in' => 'This is invalid.', - 'in_array' => 'This field does not exist in :other.', - 'integer' => 'Must be an integer.', - 'ip' => 'Must be a valid IP address.', - 'ipv4' => 'Must be a valid IPv4 address.', - 'ipv6' => 'Must be a valid IPv6 address.', - 'json' => 'Must be a valid JSON string.', - 'lt' => [ + 'image' => 'Must be an image.', + 'in' => 'This is invalid.', + 'in_array' => 'This field does not exist in :other.', + 'integer' => 'Must be an integer.', + 'ip' => 'Must be a valid IP address.', + 'ipv4' => 'Must be a valid IPv4 address.', + 'ipv6' => 'Must be a valid IPv6 address.', + 'json' => 'Must be a valid JSON string.', + 'lt' => [ 'numeric' => 'Must be less than :value.', - 'file' => 'Must be less than :value kilobytes.', - 'string' => 'Must be less than :value characters.', - 'array' => 'Must have less than :value items.', + 'file' => 'Must be less than :value kilobytes.', + 'string' => 'Must be less than :value characters.', + 'array' => 'Must have less than :value items.', ], - 'lte' => [ + 'lte' => [ 'numeric' => 'Must be less than or equal :value.', - 'file' => 'Must be less than or equal :value kilobytes.', - 'string' => 'Must be less than or equal :value characters.', - 'array' => 'Must not have more than :value items.', + 'file' => 'Must be less than or equal :value kilobytes.', + 'string' => 'Must be less than or equal :value characters.', + 'array' => 'Must not have more than :value items.', ], - 'max' => [ + 'max' => [ 'numeric' => 'May not be greater than :max.', - 'file' => 'May not be greater than :max kilobytes.', - 'string' => 'May not be greater than :max characters.', - 'array' => 'May not have more than :max items.', + 'file' => 'May not be greater than :max kilobytes.', + 'string' => 'May not be greater than :max characters.', + 'array' => 'May not have more than :max items.', ], - 'mimes' => 'Must be a file of type: :values.', - 'mimetypes' => 'Must be a file of type: :values.', - 'min' => [ + 'mimes' => 'Must be a file of type: :values.', + 'mimetypes' => 'Must be a file of type: :values.', + 'min' => [ 'numeric' => 'Must be at least :min.', - 'file' => 'Must be at least :min kilobytes.', - 'string' => 'Must be at least :min characters.', - 'array' => 'Must have at least :min items.', + 'file' => 'Must be at least :min kilobytes.', + 'string' => 'Must be at least :min characters.', + 'array' => 'Must have at least :min items.', ], - 'not_in' => 'This is invalid.', - 'not_regex' => 'Format is invalid.', - 'numeric' => 'Must be a number.', - 'present' => 'Must be present.', - 'regex' => 'Format is invalid.', - 'required' => 'This field is required.', - 'required_if' => 'This field is required when :other is :value.', - 'required_unless' => 'This field is required unless :other is in :values.', - 'required_with' => 'This field is required when :values is present.', - 'required_with_all' => 'This field is required when :values is present.', - 'required_without' => 'This field is required when :values is not present.', + 'not_in' => 'This is invalid.', + 'not_regex' => 'Format is invalid.', + 'numeric' => 'Must be a number.', + 'present' => 'Must be present.', + 'regex' => 'Format is invalid.', + 'required' => 'This field is required.', + 'required_if' => 'This field is required when :other is :value.', + 'required_unless' => 'This field is required unless :other is in :values.', + 'required_with' => 'This field is required when :values is present.', + 'required_with_all' => 'This field is required when :values is present.', + 'required_without' => 'This field is required when :values is not present.', 'required_without_all' => 'This field is required when none of :values are present.', - 'same' => 'This field and :other must match.', - 'size' => [ + 'same' => 'This field and :other must match.', + 'size' => [ 'numeric' => 'Must be :size.', - 'file' => 'Must be :size kilobytes.', - 'string' => 'Must be :size characters.', - 'array' => 'Must contain :size items.', + 'file' => 'Must be :size kilobytes.', + 'string' => 'Must be :size characters.', + 'array' => 'Must contain :size items.', ], - 'starts_with' => 'Must start with :values', - 'string' => 'Must be a string.', - 'timezone' => 'Must be a valid zone.', - 'unique' => 'This value has already been taken.', - 'uploaded' => 'Failed to upload.', - 'url' => 'Format is invalid.', + 'starts_with' => 'Must start with :values', + 'string' => 'Must be a string.', + 'timezone' => 'Must be a valid zone.', + 'unique' => 'This value has already been taken.', + 'uploaded' => 'Failed to upload.', + 'url' => 'Format is invalid.', /* |-------------------------------------------------------------------------- diff --git a/resources/lang/es/validation.php b/resources/lang/es/validation.php index 365bc3d730..44975787c6 100644 --- a/resources/lang/es/validation.php +++ b/resources/lang/es/validation.php @@ -12,107 +12,107 @@ | varias versiones, como las reglas del tamaño. Puedes modificarlos aquí. */ - 'accepted' => 'Debes aceptar esto', - 'active_url' => 'Este no es un URL válido.', - 'after' => 'Debe ser una fecha posterior a :date.', - 'after_or_equal' => 'Debe ser una fecha posterior o igual a :date.', - 'alpha' => 'Solo puede contener letras.', - 'alpha_dash' => 'Solo puede contener letras, números y guiones medios o bajos.', - 'alpha_num' => 'Solo puede contener letras y números.', - 'array' => 'Debe ser un arreglo.', - 'before' => 'Debe ser una fecha anterior a :date.', - 'before_or_equal' => 'Debe ser una fecha anterior o igual a :date.', - 'between' => [ + 'accepted' => 'Debes aceptar esto', + 'active_url' => 'Este no es un URL válido.', + 'after' => 'Debe ser una fecha posterior a :date.', + 'after_or_equal' => 'Debe ser una fecha posterior o igual a :date.', + 'alpha' => 'Solo puede contener letras.', + 'alpha_dash' => 'Solo puede contener letras, números y guiones medios o bajos.', + 'alpha_num' => 'Solo puede contener letras y números.', + 'array' => 'Debe ser un arreglo.', + 'before' => 'Debe ser una fecha anterior a :date.', + 'before_or_equal' => 'Debe ser una fecha anterior o igual a :date.', + 'between' => [ 'numeric' => 'Debe estar entre :min y :max.', - 'file' => 'Debe tener entre :min y :max kb.', - 'string' => 'Debe tener entre :min y :max caracteres.', - 'array' => 'Debe tener entre :min y :max elementos.', + 'file' => 'Debe tener entre :min y :max kb.', + 'string' => 'Debe tener entre :min y :max caracteres.', + 'array' => 'Debe tener entre :min y :max elementos.', ], - 'boolean' => 'Debe ser verdadero o falso.', - 'confirmed' => 'La confirmación no coincide.', - 'current_password' => 'La contraseña es incorrecta.', - 'date' => 'No es una fecha válida.', - 'date_format' => 'No coincide con el formato :format.', - 'different' => 'Este campo y :other deben ser diferentes.', - 'digits' => 'Debe tener :digits dígitos.', - 'digits_between' => 'Debe tener entre :min y :max dígitos.', - 'dimensions' => 'Dimensiones de imagen inválidas', - 'distinct' => 'Este campo tiene un valor duplicado.', - 'email' => 'Debe ser una dirección de email válida.', - 'exists' => 'Esto no es válido.', - 'file' => 'Debe ser un archivo.', - 'filled' => 'No puede estar vacío.', - 'gt' => [ + 'boolean' => 'Debe ser verdadero o falso.', + 'confirmed' => 'La confirmación no coincide.', + 'current_password' => 'La contraseña es incorrecta.', + 'date' => 'No es una fecha válida.', + 'date_format' => 'No coincide con el formato :format.', + 'different' => 'Este campo y :other deben ser diferentes.', + 'digits' => 'Debe tener :digits dígitos.', + 'digits_between' => 'Debe tener entre :min y :max dígitos.', + 'dimensions' => 'Dimensiones de imagen inválidas', + 'distinct' => 'Este campo tiene un valor duplicado.', + 'email' => 'Debe ser una dirección de email válida.', + 'exists' => 'Esto no es válido.', + 'file' => 'Debe ser un archivo.', + 'filled' => 'No puede estar vacío.', + 'gt' => [ 'numeric' => 'Debe ser mayor a :value.', - 'file' => 'Debe ser mayor a :value kb.', - 'string' => 'Debe tener más de :value caracteres.', - 'array' => 'Debe tener más de :value elementos.', + 'file' => 'Debe ser mayor a :value kb.', + 'string' => 'Debe tener más de :value caracteres.', + 'array' => 'Debe tener más de :value elementos.', ], - 'gte' => [ + 'gte' => [ 'numeric' => 'Debe ser mayor o igual a :value.', - 'file' => 'Debe ser mayor o igual a :value kb.', - 'string' => 'Debe tener al menos :value catacteres.', - 'array' => 'Debe tener al menos :value elementos.', + 'file' => 'Debe ser mayor o igual a :value kb.', + 'string' => 'Debe tener al menos :value catacteres.', + 'array' => 'Debe tener al menos :value elementos.', ], - 'image' => 'Debe ser una imagen.', - 'in' => 'Esto no es valido.', - 'in_array' => 'Este campo no existe en :other.', - 'integer' => 'Debe ser un número entero.', - 'ip' => 'Debe ser una dirección IP válida.', - 'ipv4' => 'Debe ser una dirección IPv4 válida.', - 'ipv6' => 'Debe ser una dirección IPv6 válida.', - 'json' => 'Debe ser una cadena de JSON válida.', - 'lt' => [ + 'image' => 'Debe ser una imagen.', + 'in' => 'Esto no es valido.', + 'in_array' => 'Este campo no existe en :other.', + 'integer' => 'Debe ser un número entero.', + 'ip' => 'Debe ser una dirección IP válida.', + 'ipv4' => 'Debe ser una dirección IPv4 válida.', + 'ipv6' => 'Debe ser una dirección IPv6 válida.', + 'json' => 'Debe ser una cadena de JSON válida.', + 'lt' => [ 'numeric' => 'Debe ser menor a :value.', - 'file' => 'Debe ser menor a :value kb.', - 'string' => 'Debe tener menos de :value caracteres.', - 'array' => 'Debe tener menos de :value elementos.', + 'file' => 'Debe ser menor a :value kb.', + 'string' => 'Debe tener menos de :value caracteres.', + 'array' => 'Debe tener menos de :value elementos.', ], - 'lte' => [ + 'lte' => [ 'numeric' => 'Debe ser menor o igual a :value.', - 'file' => 'Debe ser menor o igual a :value kb.', - 'string' => 'Debe tener :value caracteres o menos.', - 'array' => 'Debe tener :value elementos o menos.', + 'file' => 'Debe ser menor o igual a :value kb.', + 'string' => 'Debe tener :value caracteres o menos.', + 'array' => 'Debe tener :value elementos o menos.', ], - 'max' => [ + 'max' => [ 'numeric' => 'Debe ser menor a :max.', - 'file' => 'Debe ser menor a :max kb.', - 'string' => 'Debe tener menos de :max caracteres.', - 'array' => 'Debe tener menos de :max elementos.', + 'file' => 'Debe ser menor a :max kb.', + 'string' => 'Debe tener menos de :max caracteres.', + 'array' => 'Debe tener menos de :max elementos.', ], - 'mimes' => 'Debe ser un archivo de tipo :values.', - 'mimetypes' => 'Debe ser un archivo de tipo :values.', - 'min' => [ + 'mimes' => 'Debe ser un archivo de tipo :values.', + 'mimetypes' => 'Debe ser un archivo de tipo :values.', + 'min' => [ 'numeric' => 'Debe ser al menos :min.', - 'file' => 'Debe pesar al menos :min kb.', - 'string' => 'Debe ser de al menos :min caracteres.', - 'array' => 'Debe tener al menos :min elementos.', + 'file' => 'Debe pesar al menos :min kb.', + 'string' => 'Debe ser de al menos :min caracteres.', + 'array' => 'Debe tener al menos :min elementos.', ], - 'not_in' => 'Esto no es valido.', - 'not_regex' => 'El formato es inválido', - 'numeric' => 'Tiene que ser un número.', - 'present' => 'Debe estar presente.', - 'regex' => 'El formato es inválido', - 'required' => 'Este campo es obligatorio.', - 'required_if' => 'Este campo es obligatorio cuando :other es :value.', - 'required_unless' => 'Este campo es obligatorio a menos que :other esté en :values.', - 'required_with' => 'Este campo es obligatorio cuando :values está presente.', - 'required_with_all' => 'Este campo es obligatorio cuando :values está presente.', - 'required_without' => 'Este campo es obligatorio cuando :values no está presente.', + 'not_in' => 'Esto no es valido.', + 'not_regex' => 'El formato es inválido', + 'numeric' => 'Tiene que ser un número.', + 'present' => 'Debe estar presente.', + 'regex' => 'El formato es inválido', + 'required' => 'Este campo es obligatorio.', + 'required_if' => 'Este campo es obligatorio cuando :other es :value.', + 'required_unless' => 'Este campo es obligatorio a menos que :other esté en :values.', + 'required_with' => 'Este campo es obligatorio cuando :values está presente.', + 'required_with_all' => 'Este campo es obligatorio cuando :values está presente.', + 'required_without' => 'Este campo es obligatorio cuando :values no está presente.', 'required_without_all' => 'Este campo es obligatorio cuando :values no está presente.', - 'same' => 'Este campo y :other deben coincidir.', - 'size' => [ + 'same' => 'Este campo y :other deben coincidir.', + 'size' => [ 'numeric' => 'Debe ser :size.', - 'file' => 'Debe pesar :size kb.', - 'string' => 'Debe tener :size caracteres.', - 'array' => 'Debe tener :size elementos.', + 'file' => 'Debe pesar :size kb.', + 'string' => 'Debe tener :size caracteres.', + 'array' => 'Debe tener :size elementos.', ], - 'string' => 'Debe ser un texto.', - 'timezone' => 'Debe ser una zona horaria válida.', - 'unique' => 'Este valor ya ha sido tomado.', - 'uploaded' => 'Error al cargar', - 'url' => 'El formato es inválido', + 'string' => 'Debe ser un texto.', + 'timezone' => 'Debe ser una zona horaria válida.', + 'unique' => 'Este valor ya ha sido tomado.', + 'uploaded' => 'Error al cargar', + 'url' => 'El formato es inválido', /* |-------------------------------------------------------------------------- @@ -123,11 +123,11 @@ | */ - 'unique_entry_value' => 'Este valor ya ha sido tomado.', - 'unique_term_value' => 'Este valor ya ha sido tomado.', - 'unique_user_value' => 'Este valor ya ha sido tomado.', - 'duplicate_field_handle' => 'El campo con un identificador de :handle no se puede usar más de una vez.', - 'one_site_without_origin' => 'Al menos un sitio no debe tener un origen.', + 'unique_entry_value' => 'Este valor ya ha sido tomado.', + 'unique_term_value' => 'Este valor ya ha sido tomado.', + 'unique_user_value' => 'Este valor ya ha sido tomado.', + 'duplicate_field_handle' => 'El campo con un identificador de :handle no se puede usar más de una vez.', + 'one_site_without_origin' => 'Al menos un sitio no debe tener un origen.', 'origin_cannot_be_disabled' => 'No se puede seleccionar un origen inhabilitado.', 'unique_uri' => 'Este URI ya se ha tomado.', 'duplicate_uri' => 'URI duplicada :value', diff --git a/resources/lang/ms/validation.php b/resources/lang/ms/validation.php index 701275bdf3..35d82affc4 100644 --- a/resources/lang/ms/validation.php +++ b/resources/lang/ms/validation.php @@ -13,106 +13,106 @@ | */ - 'accepted' => 'Mesti diterima.', - 'active_url' => 'Ini bukan URL yang sah.', - 'after' => 'Mesti tarikh selepas :date.', - 'after_or_equal' => 'Mestilah tarikh selepas atau sama dengan :date.', - 'alpha' => 'Hanya boleh mengandungi huruf.', - 'alpha_dash' => 'Hanya boleh mengandungi huruf, nombor, sempang dan garis bawah.', - 'alpha_num' => 'Hanya boleh mengandungi huruf dan nombor.', - 'array' => 'Mestilah array.', - 'before' => 'Mesti tarikh sebelum :date.', - 'before_or_equal' => 'Mestilah tarikh sebelum atau sama dengan :date.', - 'between' => [ + 'accepted' => 'Mesti diterima.', + 'active_url' => 'Ini bukan URL yang sah.', + 'after' => 'Mesti tarikh selepas :date.', + 'after_or_equal' => 'Mestilah tarikh selepas atau sama dengan :date.', + 'alpha' => 'Hanya boleh mengandungi huruf.', + 'alpha_dash' => 'Hanya boleh mengandungi huruf, nombor, sempang dan garis bawah.', + 'alpha_num' => 'Hanya boleh mengandungi huruf dan nombor.', + 'array' => 'Mestilah array.', + 'before' => 'Mesti tarikh sebelum :date.', + 'before_or_equal' => 'Mestilah tarikh sebelum atau sama dengan :date.', + 'between' => [ 'numeric' => 'Mesti antara :min dan :max.', - 'file' => 'Mesti antara :min dan :max kilobait.', - 'string' => 'Mesti antara :min dan :max aksara.', - 'array' => 'Mesti ada antara :min dan :max item.', + 'file' => 'Mesti antara :min dan :max kilobait.', + 'string' => 'Mesti antara :min dan :max aksara.', + 'array' => 'Mesti ada antara :min dan :max item.', ], - 'boolean' => 'Mesti betul atau salah.', - 'confirmed' => 'Pengesahan tidak sepadan dengan e-mel', - 'current_password' => 'Katalaluan anda adalah salah.', - 'date' => 'Bukan tarikh yang sah.', - 'date_format' => 'Tidak sepadan dengan format :format.', - 'different' => 'Bidang ini dan :other mestilah berbeza.', - 'digits' => 'Mestilah :digits digit.', - 'digits_between' => 'Mesti antara :min dan :max digit.', - 'dimensions' => 'Dimensi imej tidak sah.', - 'distinct' => 'Bidang ini mempunyai nilai pendua.', - 'email' => 'Mesti alamat e-mel yang sah.', - 'exists' => 'Ini tidak sah.', - 'file' => 'Mestilah fail.', - 'filled' => 'Mesti ada nilai.', - 'gt' => [ + 'boolean' => 'Mesti betul atau salah.', + 'confirmed' => 'Pengesahan tidak sepadan dengan e-mel', + 'current_password' => 'Katalaluan anda adalah salah.', + 'date' => 'Bukan tarikh yang sah.', + 'date_format' => 'Tidak sepadan dengan format :format.', + 'different' => 'Bidang ini dan :other mestilah berbeza.', + 'digits' => 'Mestilah :digits digit.', + 'digits_between' => 'Mesti antara :min dan :max digit.', + 'dimensions' => 'Dimensi imej tidak sah.', + 'distinct' => 'Bidang ini mempunyai nilai pendua.', + 'email' => 'Mesti alamat e-mel yang sah.', + 'exists' => 'Ini tidak sah.', + 'file' => 'Mestilah fail.', + 'filled' => 'Mesti ada nilai.', + 'gt' => [ 'numeric' => 'Mesti lebih besar daripada :value.', - 'file' => 'Mesti lebih besar daripada :value kilobait.', - 'string' => 'Mesti lebih besar daripada aksara :value.', - 'array' => 'Mesti mempunyai lebih daripada :value item.', + 'file' => 'Mesti lebih besar daripada :value kilobait.', + 'string' => 'Mesti lebih besar daripada aksara :value.', + 'array' => 'Mesti mempunyai lebih daripada :value item.', ], - 'gte' => [ + 'gte' => [ 'numeric' => 'Mesti lebih besar daripada atau sama dengan :value.', - 'file' => 'Mesti lebih besar daripada atau sama dengan :value kilobait.', - 'string' => 'Mesti lebih besar daripada atau sama dengan aksara :value.', - 'array' => 'Mesti mempunyai :value item atau lebih.', + 'file' => 'Mesti lebih besar daripada atau sama dengan :value kilobait.', + 'string' => 'Mesti lebih besar daripada atau sama dengan aksara :value.', + 'array' => 'Mesti mempunyai :value item atau lebih.', ], - 'image' => 'Mestilah gambar.', - 'in' => 'Ini tidak sah.', - 'in_array' => 'Bidang ini tidak wujud dalam :other.', - 'integer' => 'Mestilah integer.', - 'ip' => 'Mestilah alamat IP yang sah.', - 'ipv4' => 'Mestilah alamat IPv4 yang sah.', - 'ipv6' => 'Mestilah alamat IPv6 yang sah.', - 'json' => 'Mestilah rentetan JSON yang sah.', - 'lt' => [ + 'image' => 'Mestilah gambar.', + 'in' => 'Ini tidak sah.', + 'in_array' => 'Bidang ini tidak wujud dalam :other.', + 'integer' => 'Mestilah integer.', + 'ip' => 'Mestilah alamat IP yang sah.', + 'ipv4' => 'Mestilah alamat IPv4 yang sah.', + 'ipv6' => 'Mestilah alamat IPv6 yang sah.', + 'json' => 'Mestilah rentetan JSON yang sah.', + 'lt' => [ 'numeric' => 'Mesti kurang daripada :value.', - 'file' => 'Mesti kurang daripada :value kilobait.', - 'string' => 'Mesti kurang daripada :value aksara.', - 'array' => 'Mesti mempunyai kurang daripada :value item.', + 'file' => 'Mesti kurang daripada :value kilobait.', + 'string' => 'Mesti kurang daripada :value aksara.', + 'array' => 'Mesti mempunyai kurang daripada :value item.', ], - 'lte' => [ + 'lte' => [ 'numeric' => 'Mesti kurang daripada atau sama dengan :value.', - 'file' => 'Mesti kurang daripada atau sama :value kilobait.', - 'string' => 'Mesti kurang daripada atau sama dengan aksara :value.', - 'array' => 'Tidak boleh mempunyai lebih daripada :value item.', + 'file' => 'Mesti kurang daripada atau sama :value kilobait.', + 'string' => 'Mesti kurang daripada atau sama dengan aksara :value.', + 'array' => 'Tidak boleh mempunyai lebih daripada :value item.', ], - 'max' => [ + 'max' => [ 'numeric' => 'Tidak boleh lebih besar daripada :max.', - 'file' => 'Tidak boleh lebih besar daripada :max kilobait.', - 'string' => 'Tidak boleh lebih besar daripada :max aksara.', - 'array' => 'Tidak boleh mempunyai lebih daripada :max item.', + 'file' => 'Tidak boleh lebih besar daripada :max kilobait.', + 'string' => 'Tidak boleh lebih besar daripada :max aksara.', + 'array' => 'Tidak boleh mempunyai lebih daripada :max item.', ], - 'mimes' => 'Mestilah fail jenis: :values.', - 'mimetypes' => 'Mestilah fail jenis: :values.', - 'min' => [ + 'mimes' => 'Mestilah fail jenis: :values.', + 'mimetypes' => 'Mestilah fail jenis: :values.', + 'min' => [ 'numeric' => 'Mesti sekurang-kurangnya :min.', - 'file' => 'Mesti sekurang-kurangnya :min kilobait.', - 'string' => 'Mesti sekurang-kurangnya :min aksara.', - 'array' => 'Mesti mempunyai sekurang-kurangnya :min item.', + 'file' => 'Mesti sekurang-kurangnya :min kilobait.', + 'string' => 'Mesti sekurang-kurangnya :min aksara.', + 'array' => 'Mesti mempunyai sekurang-kurangnya :min item.', ], - 'not_in' => 'Ini tidak sah.', - 'not_regex' => 'Format tidak sah.', - 'numeric' => 'Mesti nombor.', - 'present' => 'Mesti wujud.', - 'regex' => 'Format tidak sah.', - 'required' => 'Bidang ini diperlukan.', - 'required_if' => 'Bidang ini diperlukan apabila :other ialah :value.', - 'required_unless' => 'Bidang ini diperlukan melainkan :other berada dalam :values.', - 'required_with' => 'Bidang ini diperlukan apabila :values ​​wujud.', - 'required_with_all' => 'Bidang ini diperlukan apabila :values ​​wujud.', - 'required_without' => 'Bidang ini diperlukan apabila :values ​​tidak ada.', + 'not_in' => 'Ini tidak sah.', + 'not_regex' => 'Format tidak sah.', + 'numeric' => 'Mesti nombor.', + 'present' => 'Mesti wujud.', + 'regex' => 'Format tidak sah.', + 'required' => 'Bidang ini diperlukan.', + 'required_if' => 'Bidang ini diperlukan apabila :other ialah :value.', + 'required_unless' => 'Bidang ini diperlukan melainkan :other berada dalam :values.', + 'required_with' => 'Bidang ini diperlukan apabila :values ​​wujud.', + 'required_with_all' => 'Bidang ini diperlukan apabila :values ​​wujud.', + 'required_without' => 'Bidang ini diperlukan apabila :values ​​tidak ada.', 'required_without_all' => 'Bidang ini diperlukan apabila tiada :values ​​wujud.', - 'same' => 'Bidang ini dan :other mesti sepadan.', - 'size' => [ + 'same' => 'Bidang ini dan :other mesti sepadan.', + 'size' => [ 'numeric' => 'Mestilah :size.', - 'file' => 'Mestilah :size kilobait.', - 'string' => 'Mestilah :size aksara.', - 'array' => 'Mesti mengandungi :size item.', + 'file' => 'Mestilah :size kilobait.', + 'string' => 'Mestilah :size aksara.', + 'array' => 'Mesti mengandungi :size item.', ], - 'string' => 'Mesti rentetan.', - 'timezone' => 'Mesti zon yang sah.', - 'unique' => 'Nilai ini telah pun diambil.', - 'uploaded' => 'Gagal memuat naik.', - 'url' => 'Format tidak sah.', + 'string' => 'Mesti rentetan.', + 'timezone' => 'Mesti zon yang sah.', + 'unique' => 'Nilai ini telah pun diambil.', + 'uploaded' => 'Gagal memuat naik.', + 'url' => 'Format tidak sah.', /* |-------------------------------------------------------------------------- diff --git a/resources/lang/tr/validation.php b/resources/lang/tr/validation.php index 80d7ad65a5..16356d1029 100644 --- a/resources/lang/tr/validation.php +++ b/resources/lang/tr/validation.php @@ -39,15 +39,15 @@ 'filled' => ':attribute alanının doldurulması zorunludur.', 'gt' => [ 'numeric' => ':attribute, :value değerinden büyük olmalı.', - 'file' => ':attribute, :value kilobayt boyutundan büyük olmalı.', - 'string' => ':attribute, :value karakterden uzun olmalı.', - 'array' => ':attribute, :value taneden fazla olmalı.', + 'file' => ':attribute, :value kilobayt boyutundan büyük olmalı.', + 'string' => ':attribute, :value karakterden uzun olmalı.', + 'array' => ':attribute, :value taneden fazla olmalı.', ], 'gte' => [ 'numeric' => ':attribute, :value kadar veya daha fazla olmalı.', - 'file' => ':attribute, :value kilobayt boyutu kadar veya daha büyük olmalı.', - 'string' => ':attribute, :value karakter kadar veya daha uzun olmalı.', - 'array' => ':attribute, :value tane veya daha fazla olmalı.', + 'file' => ':attribute, :value kilobayt boyutu kadar veya daha büyük olmalı.', + 'string' => ':attribute, :value karakter kadar veya daha uzun olmalı.', + 'array' => ':attribute, :value tane veya daha fazla olmalı.', ], 'image' => ':attribute alanı resim dosyası olmalıdır.', 'in' => ':attribute değeri geçersiz.', @@ -59,15 +59,15 @@ 'json' => ':attribute geçerli bir JSON değişkeni olmalıdır.', 'lt' => [ 'numeric' => ':attribute, :value değerinden küçük olmalı.', - 'file' => ':attribute, :value kilobayt boyutundan küçük olmalı.', - 'string' => ':attribute, :value karakterden kısa olmalı.', - 'array' => ':attribute, :value taneden az olmalı.', + 'file' => ':attribute, :value kilobayt boyutundan küçük olmalı.', + 'string' => ':attribute, :value karakterden kısa olmalı.', + 'array' => ':attribute, :value taneden az olmalı.', ], 'lte' => [ 'numeric' => ':attribute, :value kadar veya daha küçük olmalı.', - 'file' => ':attribute, :value kilobayt boyutu kadar veya daha küçük olmalı.', - 'string' => ':attribute, :value karakter kadar veya daha kısa olmalı.', - 'array' => ':attribute, :value tane veya daha az olmalı.', + 'file' => ':attribute, :value kilobayt boyutu kadar veya daha küçük olmalı.', + 'string' => ':attribute, :value karakter kadar veya daha kısa olmalı.', + 'array' => ':attribute, :value tane veya daha az olmalı.', ], 'mac_address' => ':attribute geçerli bir MAC adresi olmalıdır.', 'max' => [ diff --git a/resources/lang/zh_CN/validation.php b/resources/lang/zh_CN/validation.php index 36f51402f4..be18fc43a0 100644 --- a/resources/lang/zh_CN/validation.php +++ b/resources/lang/zh_CN/validation.php @@ -13,106 +13,106 @@ | */ - 'accepted' => '必须接受。', - 'active_url' => '这不是有效的URL。', - 'after' => '必须为 :date 之后的日期。', - 'after_or_equal' => '必须为 :date 或之后的日期。', - 'alpha' => '只能包含字母。', - 'alpha_dash' => '只能包含字母,数字,破折号和下划线。', - 'alpha_num' => '只能包含字母和数字。', - 'array' => '必须是一个数组。', - 'before' => '必须为 :date 之前的日期。', - 'before_or_equal' => '必须为 :date 或之前的日期。', - 'between' => [ + 'accepted' => '必须接受。', + 'active_url' => '这不是有效的URL。', + 'after' => '必须为 :date 之后的日期。', + 'after_or_equal' => '必须为 :date 或之后的日期。', + 'alpha' => '只能包含字母。', + 'alpha_dash' => '只能包含字母,数字,破折号和下划线。', + 'alpha_num' => '只能包含字母和数字。', + 'array' => '必须是一个数组。', + 'before' => '必须为 :date 之前的日期。', + 'before_or_equal' => '必须为 :date 或之前的日期。', + 'between' => [ 'numeric' => '必须介于 :min 和 :max 之间。', - 'file' => '必须介于 :min 和 :max Kb之间。', - 'string' => '必须介于 :min 和 :max 个字符之间。', - 'array' => '必须包含 :min 和 :max 之间的项目。', + 'file' => '必须介于 :min 和 :max Kb之间。', + 'string' => '必须介于 :min 和 :max 个字符之间。', + 'array' => '必须包含 :min 和 :max 之间的项目。', ], - 'boolean' => '必须为真或假。', - 'confirmed' => '确认不匹配。', - 'current_password' => '密码错误。', - 'date' => '无效日期', - 'date_format' => '与格式 :format 不匹配', - 'different' => '此字段和 :other 必须不同。', - 'digits' => '必须为 :digits 位数。', - 'digits_between' => '必须介于 :min 和 :max 位数之间。', - 'dimensions' => '无效的图像尺寸。', - 'distinct' => '该字段具有重复值。', - 'email' => '必须是有效的电子邮件地址。', - 'exists' => '这是无效的。', - 'file' => '必须是一个文件。', - 'filled' => '必须具有一个值。', - 'gt' => [ + 'boolean' => '必须为真或假。', + 'confirmed' => '确认不匹配。', + 'current_password' => '密码错误。', + 'date' => '无效日期', + 'date_format' => '与格式 :format 不匹配', + 'different' => '此字段和 :other 必须不同。', + 'digits' => '必须为 :digits 位数。', + 'digits_between' => '必须介于 :min 和 :max 位数之间。', + 'dimensions' => '无效的图像尺寸。', + 'distinct' => '该字段具有重复值。', + 'email' => '必须是有效的电子邮件地址。', + 'exists' => '这是无效的。', + 'file' => '必须是一个文件。', + 'filled' => '必须具有一个值。', + 'gt' => [ 'numeric' => '必须大于 :value。', - 'file' => '必须大于 :value kb。', - 'string' => '必须大于 :value 个字符。', - 'array' => '必须包含多于 :value 项。', + 'file' => '必须大于 :value kb。', + 'string' => '必须大于 :value 个字符。', + 'array' => '必须包含多于 :value 项。', ], - 'gte' => [ + 'gte' => [ 'numeric' => '必须大于或等于 :value。', - 'file' => '必须大于或等于 :valuekb。', - 'string' => '必须大于或等于 :value 个字符。', - 'array' => '必须具有 :value 项或更多。', + 'file' => '必须大于或等于 :valuekb。', + 'string' => '必须大于或等于 :value 个字符。', + 'array' => '必须具有 :value 项或更多。', ], - 'image' => '必须是一张图像', - 'in' => '这是无效的。', - 'in_array' => '此字段在 :other 中不存在。', - 'integer' => '必须为整数。', - 'ip' => '必须是有效的 IP 地址。', - 'ipv4' => '必须是有效的 IPv4 地址。', - 'ipv6' => '必须是有效的 IPv6 地址。', - 'json' => '必须是有效的 JSON 字符串。', - 'lt' => [ + 'image' => '必须是一张图像', + 'in' => '这是无效的。', + 'in_array' => '此字段在 :other 中不存在。', + 'integer' => '必须为整数。', + 'ip' => '必须是有效的 IP 地址。', + 'ipv4' => '必须是有效的 IPv4 地址。', + 'ipv6' => '必须是有效的 IPv6 地址。', + 'json' => '必须是有效的 JSON 字符串。', + 'lt' => [ 'numeric' => '必须小于 :value。', - 'file' => '必须小于 :value kb。', - 'string' => '必须小于 :value 个字符。', - 'array' => '必须小于 :value 项。', + 'file' => '必须小于 :value kb。', + 'string' => '必须小于 :value 个字符。', + 'array' => '必须小于 :value 项。', ], - 'lte' => [ + 'lte' => [ 'numeric' => '必须小于或等于:value。', - 'file' => '必须小于或等于:valueKb。', - 'string' => '必须小于或等于:value个字符。', - 'array' => '不得超过 :value 项。', + 'file' => '必须小于或等于:valueKb。', + 'string' => '必须小于或等于:value个字符。', + 'array' => '不得超过 :value 项。', ], - 'max' => [ + 'max' => [ 'numeric' => '不得大于 :max。', - 'file' => '不得大于 :max Kb。', - 'string' => '不得大于 :max 个字符。', - 'array' => '最多只能包含 :max 项。', + 'file' => '不得大于 :max Kb。', + 'string' => '不得大于 :max 个字符。', + 'array' => '最多只能包含 :max 项。', ], - 'mimes' => '必须是以下类型的文件::values。', - 'mimetypes' => '必须是以下类型的文件::values。', - 'min' => [ + 'mimes' => '必须是以下类型的文件::values。', + 'mimetypes' => '必须是以下类型的文件::values。', + 'min' => [ 'numeric' => '必须至少为 :min。', - 'file' => '必须至少为 :minKb。', - 'string' => '必须至少为 :min 个字符。', - 'array' => '必须至少包含 :min 项。', + 'file' => '必须至少为 :minKb。', + 'string' => '必须至少为 :min 个字符。', + 'array' => '必须至少包含 :min 项。', ], - 'not_in' => '这是无效的。', - 'not_regex' => '格式无效。', - 'numeric' => '必须是数字。', - 'present' => '必须存在。', - 'regex' => '格式无效。', - 'required' => '此字段必填。', - 'required_if' => '当 :other 为 :value 时此字段必填。', - 'required_unless' => '除非 :other 在 :values 中,否则此字段必填。', - 'required_with' => '当 :values 存在时,此字段必填。', - 'required_with_all' => '当 :values 存在时,此字段必填。', - 'required_without' => '当 :values 不存在时,此字段必填。', + 'not_in' => '这是无效的。', + 'not_regex' => '格式无效。', + 'numeric' => '必须是数字。', + 'present' => '必须存在。', + 'regex' => '格式无效。', + 'required' => '此字段必填。', + 'required_if' => '当 :other 为 :value 时此字段必填。', + 'required_unless' => '除非 :other 在 :values 中,否则此字段必填。', + 'required_with' => '当 :values 存在时,此字段必填。', + 'required_with_all' => '当 :values 存在时,此字段必填。', + 'required_without' => '当 :values 不存在时,此字段必填。', 'required_without_all' => '当不存在 :values 时,此字段必填。', - 'same' => '此字段和 :other 必须匹配。', - 'size' => [ + 'same' => '此字段和 :other 必须匹配。', + 'size' => [ 'numeric' => '必须为 :size。', - 'file' => '必须为 :sizekb。', - 'string' => '必须为 :size 个字符。', - 'array' => '必须包含 :size 项。', + 'file' => '必须为 :sizekb。', + 'string' => '必须为 :size 个字符。', + 'array' => '必须包含 :size 项。', ], - 'string' => '必须是一个字符串。', - 'timezone' => '必须为有效区域。', - 'unique' => '该值已被使用。', - 'uploaded' => '上传失败。', - 'url' => '格式无效。', + 'string' => '必须是一个字符串。', + 'timezone' => '必须为有效区域。', + 'unique' => '该值已被使用。', + 'uploaded' => '上传失败。', + 'url' => '格式无效。', /* |-------------------------------------------------------------------------- diff --git a/resources/lang/zh_TW/validation.php b/resources/lang/zh_TW/validation.php index 62190b154f..0ed1f3674d 100644 --- a/resources/lang/zh_TW/validation.php +++ b/resources/lang/zh_TW/validation.php @@ -13,106 +13,106 @@ | */ - 'accepted' => '必須接受。', - 'active_url' => '不是有效的 URL。', - 'after' => '必須為 :date 之後的日期。', - 'after_or_equal' => '必須為 :date 或其之後的日期。', - 'alpha' => '只能包含字母。', - 'alpha_dash' => '只能包含字母、數字、破折號、或底線。', - 'alpha_num' => '只能包含字母與數字。', - 'array' => '只能為陣列。', - 'before' => '必須為 :date 之後的日期。', - 'before_or_equal' => '必須為 :date 或其之後的日期。', - 'between' => [ + 'accepted' => '必須接受。', + 'active_url' => '不是有效的 URL。', + 'after' => '必須為 :date 之後的日期。', + 'after_or_equal' => '必須為 :date 或其之後的日期。', + 'alpha' => '只能包含字母。', + 'alpha_dash' => '只能包含字母、數字、破折號、或底線。', + 'alpha_num' => '只能包含字母與數字。', + 'array' => '只能為陣列。', + 'before' => '必須為 :date 之後的日期。', + 'before_or_equal' => '必須為 :date 或其之後的日期。', + 'between' => [ 'numeric' => '必須介於 :min 與 :max 之間。', - 'file' => '必須介於 :min KB 至 :max KB。', - 'string' => '必須介於 :min 個字元與 :max 個字元之間。', - 'array' => '必須介於 :min 至 :max 個項目。', + 'file' => '必須介於 :min KB 至 :max KB。', + 'string' => '必須介於 :min 個字元與 :max 個字元之間。', + 'array' => '必須介於 :min 至 :max 個項目。', ], - 'boolean' => '必須為 true 或 false。', - 'confirmed' => '確認欄位不相符。', - 'current_password' => '密码错误。', - 'date' => '不是有效的日期。', - 'date_format' => '不符合格式 :format。', - 'different' => '此欄位必須與 :other 不同', - 'digits' => '必須為 :digits 位數。', - 'digits_between' => '必須介於 :min 位數至 :max 位數.', - 'dimensions' => '無效的圖片長寬。', - 'distinct' => '此欄位有重複的值。', - 'email' => '必須為有效的電子郵件位址。', - 'exists' => '該值無效。', - 'file' => '必須為檔案。', - 'filled' => '必須有值。', - 'gt' => [ + 'boolean' => '必須為 true 或 false。', + 'confirmed' => '確認欄位不相符。', + 'current_password' => '密码错误。', + 'date' => '不是有效的日期。', + 'date_format' => '不符合格式 :format。', + 'different' => '此欄位必須與 :other 不同', + 'digits' => '必須為 :digits 位數。', + 'digits_between' => '必須介於 :min 位數至 :max 位數.', + 'dimensions' => '無效的圖片長寬。', + 'distinct' => '此欄位有重複的值。', + 'email' => '必須為有效的電子郵件位址。', + 'exists' => '該值無效。', + 'file' => '必須為檔案。', + 'filled' => '必須有值。', + 'gt' => [ 'numeric' => '必須大於 :value。', - 'file' => '必須大於 :value KB。', - 'string' => '必須大於 :value 個字元。', - 'array' => '必須有多於 :value 個項目。', + 'file' => '必須大於 :value KB。', + 'string' => '必須大於 :value 個字元。', + 'array' => '必須有多於 :value 個項目。', ], - 'gte' => [ + 'gte' => [ 'numeric' => '必須大於或等於 :value。', - 'file' => '必須大於或等於 :value KB。', - 'string' => '必須大於或等於 :value 個字元。', - 'array' => '必須有至少有 :value 個或更多項目。', + 'file' => '必須大於或等於 :value KB。', + 'string' => '必須大於或等於 :value 個字元。', + 'array' => '必須有至少有 :value 個或更多項目。', ], - 'image' => '必須為圖片。', - 'in' => '該值無效。', - 'in_array' => '該欄位不包含在 :other 中。', - 'integer' => '必須為整數。', - 'ip' => '必須為有效的 IP 位址。', - 'ipv4' => '必須為有效的 IPv4 位址。', - 'ipv6' => '必須為有效的 IPv6 位址。', - 'json' => '必須為有效的 JSON 字串。', - 'lt' => [ + 'image' => '必須為圖片。', + 'in' => '該值無效。', + 'in_array' => '該欄位不包含在 :other 中。', + 'integer' => '必須為整數。', + 'ip' => '必須為有效的 IP 位址。', + 'ipv4' => '必須為有效的 IPv4 位址。', + 'ipv6' => '必須為有效的 IPv6 位址。', + 'json' => '必須為有效的 JSON 字串。', + 'lt' => [ 'numeric' => '必須小於 :value。', - 'file' => '必須小於 :value KB。', - 'string' => '必須少於 :value 個字元。', - 'array' => '必須少於 :value 個項目。', + 'file' => '必須小於 :value KB。', + 'string' => '必須少於 :value 個字元。', + 'array' => '必須少於 :value 個項目。', ], - 'lte' => [ + 'lte' => [ 'numeric' => '必須小於或等於 :value。', - 'file' => '必須小於或等於 :value KB。', - 'string' => '必須少於或等於 :value 個字元。', - 'array' => '最多只可有 :value 個或更少的項目。', + 'file' => '必須小於或等於 :value KB。', + 'string' => '必須少於或等於 :value 個字元。', + 'array' => '最多只可有 :value 個或更少的項目。', ], - 'max' => [ + 'max' => [ 'numeric' => '不可大於 :max。', - 'file' => '不可大於 :max KB。', - 'string' => '不可大於 :max 個字元。', - 'array' => '不可有多於 :max 個項目。', + 'file' => '不可大於 :max KB。', + 'string' => '不可大於 :max 個字元。', + 'array' => '不可有多於 :max 個項目。', ], - 'mimes' => '必須為檔案類型::values。', - 'mimetypes' => '必須為檔案類型::values。', - 'min' => [ + 'mimes' => '必須為檔案類型::values。', + 'mimetypes' => '必須為檔案類型::values。', + 'min' => [ 'numeric' => '最少必須為 :min。', - 'file' => '最少必須有 :min KB。', - 'string' => '最少必須有 :min 個字元。', - 'array' => '最少必須有 :min 個項目。', + 'file' => '最少必須有 :min KB。', + 'string' => '最少必須有 :min 個字元。', + 'array' => '最少必須有 :min 個項目。', ], - 'not_in' => '該值無效。', - 'not_regex' => '格式無效。', - 'numeric' => '必須為數字。', - 'present' => '必須有該欄位。', - 'regex' => '格式無效', - 'required' => '該欄位為必填。', - 'required_if' => '當 :other 為 :value 時,該欄位為必填。', - 'required_unless' => '除非 :other 為 :value,否則該欄位為必填。', - 'required_with' => '當有 :values 時,該欄位為必填。', - 'required_with_all' => '當有 :values 時,該欄位為必填。', - 'required_without' => '當沒有 :values 時,該欄位為必填。', + 'not_in' => '該值無效。', + 'not_regex' => '格式無效。', + 'numeric' => '必須為數字。', + 'present' => '必須有該欄位。', + 'regex' => '格式無效', + 'required' => '該欄位為必填。', + 'required_if' => '當 :other 為 :value 時,該欄位為必填。', + 'required_unless' => '除非 :other 為 :value,否則該欄位為必填。', + 'required_with' => '當有 :values 時,該欄位為必填。', + 'required_with_all' => '當有 :values 時,該欄位為必填。', + 'required_without' => '當沒有 :values 時,該欄位為必填。', 'required_without_all' => '當都沒有 :values 時,該欄位為必填。', - 'same' => '該欄位必須與 :other 相同。', - 'size' => [ + 'same' => '該欄位必須與 :other 相同。', + 'size' => [ 'numeric' => '必須為 :size。', - 'file' => '必須為 :size KB。', - 'string' => '必須為 :size 個字元。', - 'array' => '必須包含 :size 個項目。', + 'file' => '必須為 :size KB。', + 'string' => '必須為 :size 個字元。', + 'array' => '必須包含 :size 個項目。', ], - 'string' => '必須為字串。', - 'timezone' => '必須為有效的時區。', - 'unique' => '該值已被使用。', - 'uploaded' => '無法上傳。', - 'url' => '格式無效。', + 'string' => '必須為字串。', + 'timezone' => '必須為有效的時區。', + 'unique' => '該值已被使用。', + 'uploaded' => '無法上傳。', + 'url' => '格式無效。', /* |-------------------------------------------------------------------------- diff --git a/src/API/Cacher.php b/src/API/Cacher.php index dd68693177..15f67e29b0 100644 --- a/src/API/Cacher.php +++ b/src/API/Cacher.php @@ -11,7 +11,6 @@ interface Cacher /** * Get a response from the cache. * - * @param Request $request * @return JsonResponse|null */ public function get(Request $request); @@ -19,8 +18,6 @@ public function get(Request $request); /** * Put a response into the cache. * - * @param Request $request - * @param JsonResponse $response * @return void */ public function put(Request $request, JsonResponse $response); @@ -28,7 +25,6 @@ public function put(Request $request, JsonResponse $response); /** * Handle event based API cache invalidation. * - * @param Event $event * @return void */ public function handleInvalidationEvent(Event $event); diff --git a/src/API/Cachers/DefaultCacher.php b/src/API/Cachers/DefaultCacher.php index 57fa03c888..8c4ea6cf5d 100644 --- a/src/API/Cachers/DefaultCacher.php +++ b/src/API/Cachers/DefaultCacher.php @@ -31,7 +31,6 @@ public function put(Request $request, JsonResponse $response) /** * Handle event based API cache invalidation. * - * @param Event $event * @return void */ public function handleInvalidationEvent(Event $event) @@ -88,7 +87,6 @@ protected function getTrackingKey() /** * Get cache key for endpoint. * - * @param Request $request * @return string */ protected function getCacheKey(Request $request) diff --git a/src/API/Middleware/Cache.php b/src/API/Middleware/Cache.php index 288d061298..5bba8aa3ce 100644 --- a/src/API/Middleware/Cache.php +++ b/src/API/Middleware/Cache.php @@ -12,7 +12,6 @@ class Cache * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/src/Assets/Asset.php b/src/Assets/Asset.php index 15960d6317..387372b54e 100644 --- a/src/Assets/Asset.php +++ b/src/Assets/Asset.php @@ -521,7 +521,7 @@ public function isPdf() /** * Get the file download url. - * + * * @return string */ public function cpDownloadUrl() @@ -712,7 +712,6 @@ public function move($folder, $filename = null) /** * Replace an asset and/or its references where necessary. * - * @param Asset $originalAsset * @param bool $deleteOriginal * @return $this */ @@ -803,8 +802,6 @@ public function orientation() /** * Get the asset's ratio. - * - * @return */ public function ratio() { @@ -845,7 +842,6 @@ public function title() /** * Upload a file. * - * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file * @return $this */ public function upload(UploadedFile $file) diff --git a/src/Assets/AssetContainerContents.php b/src/Assets/AssetContainerContents.php index ba9fb03af1..b4e24e8c5c 100644 --- a/src/Assets/AssetContainerContents.php +++ b/src/Assets/AssetContainerContents.php @@ -43,8 +43,6 @@ public function all() /** * Flysystem's `DirectoryListing` gives us type, timestamps, dirname, and will allow us perform more efficient filtering, caching, etc. - * - * @return DirectoryListing */ private function getRawFlysystemDirectoryListing(): DirectoryListing { @@ -85,9 +83,6 @@ private function normalizeFlysystemAttributes($attributes) * Note: S3 doesn't always return directories as part of the listings, so * this method ensures we get consistent results with S3 filesystems. * For more info, see: https://github.com/statamic/cms/pull/7205 - * - * @param Collection $files - * @return Collection */ private function ensureMissingDirectoriesExist(Collection $files): Collection { diff --git a/src/Assets/AssetContainerManager.php b/src/Assets/AssetContainerManager.php index bb2cacc767..da68eec326 100644 --- a/src/Assets/AssetContainerManager.php +++ b/src/Assets/AssetContainerManager.php @@ -43,8 +43,6 @@ public function getAbsoluteUrl($url) * Since a directory cannot reliably be detected as a URL, a * temporary file will be written, and we'll check for that directly. * - * @param $url - * @param $path * @return bool */ public function urlExists($url, $path) @@ -66,7 +64,6 @@ public function urlExists($url, $path) * Get an Amazon S3 filesystem instance. * * @param array $config An array containing key, secret, region, bucket, and path. - * @return */ public function createS3Filesystem($config) { diff --git a/src/Assets/AssetReferenceUpdater.php b/src/Assets/AssetReferenceUpdater.php index ecf0f16e8e..9fb38b9b20 100644 --- a/src/Assets/AssetReferenceUpdater.php +++ b/src/Assets/AssetReferenceUpdater.php @@ -16,7 +16,6 @@ class AssetReferenceUpdater extends DataReferenceUpdater /** * Filter by container. * - * @param string $container * @return $this */ public function filterByContainer(string $container) diff --git a/src/Auth/ResetsPasswords.php b/src/Auth/ResetsPasswords.php index fa0ebc022d..b1ca6b2639 100644 --- a/src/Auth/ResetsPasswords.php +++ b/src/Auth/ResetsPasswords.php @@ -28,7 +28,6 @@ trait ResetsPasswords * * If no token is present, display the link request form. * - * @param \Illuminate\Http\Request $request * @param string|null $token * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ @@ -42,7 +41,6 @@ public function showResetForm(Request $request, $token = null) /** * Reset the given user's password. * - * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ public function reset(Request $request) @@ -93,7 +91,6 @@ protected function validationErrorMessages() /** * Get the password reset credentials from the request. * - * @param \Illuminate\Http\Request $request * @return array */ protected function credentials(Request $request) @@ -138,7 +135,6 @@ protected function setUserPassword($user, $password) /** * Get the response for a successful password reset. * - * @param \Illuminate\Http\Request $request * @param string $response * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ @@ -149,13 +145,12 @@ protected function sendResetResponse(Request $request, $response) } return redirect($this->redirectPath()) - ->with('status', trans($response)); + ->with('status', trans($response)); } /** * Get the response for a failed password reset. * - * @param \Illuminate\Http\Request $request * @param string $response * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ @@ -168,8 +163,8 @@ protected function sendResetFailedResponse(Request $request, $response) } return redirect()->back() - ->withInput($request->only('email')) - ->withErrors(['email' => trans($response)]); + ->withInput($request->only('email')) + ->withErrors(['email' => trans($response)]); } /** diff --git a/src/Auth/SendsPasswordResetEmails.php b/src/Auth/SendsPasswordResetEmails.php index 0393174416..bf44788c84 100644 --- a/src/Auth/SendsPasswordResetEmails.php +++ b/src/Auth/SendsPasswordResetEmails.php @@ -30,7 +30,6 @@ public function showLinkRequestForm() /** * Send a reset link to the given user. * - * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ public function sendResetLinkEmail(Request $request) @@ -52,7 +51,6 @@ public function sendResetLinkEmail(Request $request) /** * Validate the email for the given request. * - * @param \Illuminate\Http\Request $request * @return void */ protected function validateEmail(Request $request) @@ -70,7 +68,6 @@ protected function validateEmail(Request $request) /** * Get the needed authentication credentials from the request. * - * @param \Illuminate\Http\Request $request * @return array */ protected function credentials(Request $request) @@ -81,7 +78,6 @@ protected function credentials(Request $request) /** * Get the response for a successful password reset link. * - * @param \Illuminate\Http\Request $request * @param string $response * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ @@ -101,7 +97,6 @@ protected function sendResetLinkResponse(Request $request, $response) /** * Get the response for a failed password reset link. * - * @param \Illuminate\Http\Request $request * @param string $response * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse */ diff --git a/src/Auth/ThrottlesLogins.php b/src/Auth/ThrottlesLogins.php index 8ce06a1333..f48e25a9b5 100644 --- a/src/Auth/ThrottlesLogins.php +++ b/src/Auth/ThrottlesLogins.php @@ -23,7 +23,6 @@ trait ThrottlesLogins /** * Determine if the user has too many failed login attempts. * - * @param \Illuminate\Http\Request $request * @return bool */ protected function hasTooManyLoginAttempts(Request $request) @@ -36,7 +35,6 @@ protected function hasTooManyLoginAttempts(Request $request) /** * Increment the login attempts for the user. * - * @param \Illuminate\Http\Request $request * @return void */ protected function incrementLoginAttempts(Request $request) @@ -49,7 +47,6 @@ protected function incrementLoginAttempts(Request $request) /** * Redirect the user after determining they are locked out. * - * @param \Illuminate\Http\Request $request * @return void * * @throws \Illuminate\Validation\ValidationException @@ -71,7 +68,6 @@ protected function sendLockoutResponse(Request $request) /** * Clear the login locks for the given user credentials. * - * @param \Illuminate\Http\Request $request * @return void */ protected function clearLoginAttempts(Request $request) @@ -82,7 +78,6 @@ protected function clearLoginAttempts(Request $request) /** * Fire an event when a lockout occurs. * - * @param \Illuminate\Http\Request $request * @return void */ protected function fireLockoutEvent(Request $request) @@ -93,7 +88,6 @@ protected function fireLockoutEvent(Request $request) /** * Get the throttle key for the given request. * - * @param \Illuminate\Http\Request $request * @return string */ protected function throttleKey(Request $request) diff --git a/src/Auth/User.php b/src/Auth/User.php index 48f4e510eb..8ac72d5b22 100644 --- a/src/Auth/User.php +++ b/src/Auth/User.php @@ -34,17 +34,7 @@ use Statamic\Statamic; use Statamic\Support\Str; -abstract class User implements - UserContract, - Authenticatable, - CanResetPasswordContract, - Augmentable, - AuthorizableContract, - ResolvesValuesContract, - HasLocalePreference, - ArrayAccess, - Arrayable, - SearchableContract +abstract class User implements UserContract, Authenticatable, CanResetPasswordContract, Augmentable, AuthorizableContract, ResolvesValuesContract, HasLocalePreference, ArrayAccess, Arrayable, SearchableContract { use Authorizable, Notifiable, CanResetPassword, HasAugmentedInstance, TracksQueriedColumns, TracksQueriedRelations, HasAvatar, ResolvesValues, ContainsComputedData, Searchable; diff --git a/src/Auth/UserProvider.php b/src/Auth/UserProvider.php index dac1e92231..d7ce4a9dcc 100644 --- a/src/Auth/UserProvider.php +++ b/src/Auth/UserProvider.php @@ -39,7 +39,6 @@ public function retrieveByToken($identifier, $token) /** * Update the "remember me" token for the given user in storage. * - * @param \Illuminate\Contracts\Auth\Authenticatable $user * @param string $token * @return void */ @@ -52,7 +51,6 @@ public function updateRememberToken(Authenticatable $user, $token) /** * Retrieve a user by the given credentials. * - * @param array $credentials * @return \Illuminate\Contracts\Auth\Authenticatable|null */ public function retrieveByCredentials(array $credentials) @@ -63,8 +61,6 @@ public function retrieveByCredentials(array $credentials) /** * Validate a user against the given credentials. * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param array $credentials * @return bool */ public function validateCredentials(Authenticatable $user, array $credentials) diff --git a/src/Auth/UserTags.php b/src/Auth/UserTags.php index 199977c9ad..8e68ed9e3a 100644 --- a/src/Auth/UserTags.php +++ b/src/Auth/UserTags.php @@ -589,7 +589,7 @@ public function notIn() } /** - * @inheritdoc + * {@inheritdoc} */ public function eventUrl($url, $relative = false) { diff --git a/src/CP/Navigation/Nav.php b/src/CP/Navigation/Nav.php index 065a273026..e2567a4d70 100644 --- a/src/CP/Navigation/Nav.php +++ b/src/CP/Navigation/Nav.php @@ -12,8 +12,6 @@ class Nav /** * Register a nav extension closure. - * - * @param Closure $callback */ public function extend(Closure $callback) { diff --git a/src/CP/Navigation/NavTransformer.php b/src/CP/Navigation/NavTransformer.php index a7bc41b0ff..b5193d1c8b 100644 --- a/src/CP/Navigation/NavTransformer.php +++ b/src/CP/Navigation/NavTransformer.php @@ -16,8 +16,6 @@ class NavTransformer /** * Instantiate nav transformer. - * - * @param array $submitted */ public function __construct(array $submitted) { @@ -29,7 +27,6 @@ public function __construct(array $submitted) /** * Transform and minify from payload submitted by `components/nav/Builder.vue`. * - * @param array $submitted * @return array */ public static function fromVue(array $submitted) diff --git a/src/CP/Utilities/CoreUtilities.php b/src/CP/Utilities/CoreUtilities.php index 3f284daca1..0c51043e37 100644 --- a/src/CP/Utilities/CoreUtilities.php +++ b/src/CP/Utilities/CoreUtilities.php @@ -10,7 +10,6 @@ use Statamic\Http\Controllers\CP\Utilities\PhpInfoController; use Statamic\Http\Controllers\CP\Utilities\UpdateSearchController; use Statamic\Statamic; - use function Statamic\trans as __; class CoreUtilities diff --git a/src/Console/Commands/Install.php b/src/Console/Commands/Install.php index cd0cfebb22..cefca3a189 100644 --- a/src/Console/Commands/Install.php +++ b/src/Console/Commands/Install.php @@ -36,12 +36,12 @@ class Install extends Command public function handle() { $this->addons() - ->createFiles() - ->publish() - ->runCallbacks() - ->clearViews() - ->clearCache() - ->runUpdateScripts(); + ->createFiles() + ->publish() + ->runCallbacks() + ->clearViews() + ->clearCache() + ->runUpdateScripts(); } protected function addons() diff --git a/src/Console/Commands/MakeAction.php b/src/Console/Commands/MakeAction.php index e887dcb866..1e83c98ff7 100644 --- a/src/Console/Commands/MakeAction.php +++ b/src/Console/Commands/MakeAction.php @@ -65,8 +65,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('actions', $actionClassValue) - ->save(); + ->add()->protected()->property('actions', $actionClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Action class in your addon's service provider."); } diff --git a/src/Console/Commands/MakeFieldtype.php b/src/Console/Commands/MakeFieldtype.php index ae4be02455..64dd08c02e 100644 --- a/src/Console/Commands/MakeFieldtype.php +++ b/src/Console/Commands/MakeFieldtype.php @@ -147,12 +147,12 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('vite', [ - 'input' => ['resources/js/addon.js'], - 'publicDirectory' => 'resources/dist', - ]) - ->add()->protected()->property('fieldtypes', $fieldtypeClassValue) - ->save(); + ->add()->protected()->property('vite', [ + 'input' => ['resources/js/addon.js'], + 'publicDirectory' => 'resources/dist', + ]) + ->add()->protected()->property('fieldtypes', $fieldtypeClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Fieldtype class and scripts in your addon's service provider."); } diff --git a/src/Console/Commands/MakeFilter.php b/src/Console/Commands/MakeFilter.php index 151736dacc..b753fa1b19 100644 --- a/src/Console/Commands/MakeFilter.php +++ b/src/Console/Commands/MakeFilter.php @@ -65,8 +65,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('filters', $filterClassValue) - ->save(); + ->add()->protected()->property('filters', $filterClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Filter class in your addon's service provider."); } diff --git a/src/Console/Commands/MakeModifier.php b/src/Console/Commands/MakeModifier.php index f0b171c3bd..96ef3e8a88 100644 --- a/src/Console/Commands/MakeModifier.php +++ b/src/Console/Commands/MakeModifier.php @@ -65,8 +65,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('modifiers', $modifierClassValue) - ->save(); + ->add()->protected()->property('modifiers', $modifierClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Modifier class in your addon's service provider."); } diff --git a/src/Console/Commands/MakeScope.php b/src/Console/Commands/MakeScope.php index 0afe238562..3fc770ad59 100644 --- a/src/Console/Commands/MakeScope.php +++ b/src/Console/Commands/MakeScope.php @@ -65,8 +65,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('scopes', $scopeClassValue) - ->save(); + ->add()->protected()->property('scopes', $scopeClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Scope class in your addon's service provider."); } diff --git a/src/Console/Commands/MakeTag.php b/src/Console/Commands/MakeTag.php index 075aa7bbc5..ed734c066c 100644 --- a/src/Console/Commands/MakeTag.php +++ b/src/Console/Commands/MakeTag.php @@ -65,8 +65,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('tags', $tagsClassValue) - ->save(); + ->add()->protected()->property('tags', $tagsClassValue) + ->save(); } catch (\Exception $e) { $this->comment("Don't forget to register the Tag class in your addon's service provider."); } diff --git a/src/Console/Commands/MakeWidget.php b/src/Console/Commands/MakeWidget.php index c52ae61ea6..61796a0bc0 100644 --- a/src/Console/Commands/MakeWidget.php +++ b/src/Console/Commands/MakeWidget.php @@ -90,8 +90,8 @@ protected function updateServiceProvider() try { PHPFile::load("addons/{$this->package}/src/ServiceProvider.php") - ->add()->protected()->property('widgets', $widgetClassValue) - ->save(); + ->add()->protected()->property('widgets', $widgetClassValue) + ->save(); } catch (\Exception $e) { $this->info("Don't forget to register the Widget class in your addon's service provider."); } diff --git a/src/Console/Composer/Lock.php b/src/Console/Composer/Lock.php index 8fb00670a8..2d30a84849 100644 --- a/src/Console/Composer/Lock.php +++ b/src/Console/Composer/Lock.php @@ -16,8 +16,6 @@ class Lock /** * Instantiate lock file helper. - * - * @param string $file */ public function __construct(string $file = 'composer.lock') { @@ -29,7 +27,6 @@ public function __construct(string $file = 'composer.lock') /** * Instantiate lock file helper. * - * @param string $file * @return static */ public static function file(string $file = 'composer.lock') @@ -39,8 +36,6 @@ public static function file(string $file = 'composer.lock') /** * Backup lock file, using vanilla PHP so that this can be run in a Composer hook. - * - * @param string $file */ public static function backup(string $file = 'composer.lock') { @@ -92,7 +87,6 @@ public function ensureExists() /** * Get installed version of a specific package. * - * @param string $package * @return string */ public function getInstalledVersion(string $package) @@ -116,7 +110,6 @@ public function getInstalledVersion(string $package) /** * Get installed version of a specific package, normalized for comparisons. * - * @param string $package * @return string */ public function getNormalizedInstalledVersion(string $package) @@ -127,7 +120,6 @@ public function getNormalizedInstalledVersion(string $package) /** * Check if package is installed. * - * @param string $package * @return bool */ public function isPackageInstalled(string $package) @@ -145,7 +137,6 @@ public function isPackageInstalled(string $package) /** * Check if package is installed as dev dependency. * - * @param string $package * @return bool */ public function isDevPackageInstalled(string $package) diff --git a/src/Console/Composer/Scripts.php b/src/Console/Composer/Scripts.php index 8f725bd8b2..2fa2971900 100644 --- a/src/Console/Composer/Scripts.php +++ b/src/Console/Composer/Scripts.php @@ -8,8 +8,6 @@ class Scripts { /** * Run Statamic pre-update-cmd hook. - * - * @param Event $event */ public static function preUpdateCmd(Event $event) { diff --git a/src/Console/Processes/Composer.php b/src/Console/Processes/Composer.php index bf369eec9d..aecd448047 100644 --- a/src/Console/Processes/Composer.php +++ b/src/Console/Processes/Composer.php @@ -43,7 +43,6 @@ public function withoutQueue() /** * Check if specific package is installed. * - * @param string $package * @return bool */ public function isInstalled(string $package) @@ -77,7 +76,6 @@ public function installed() /** * Get installed version of a specific package. * - * @param string $package * @return string */ public function installedVersion(string $package) @@ -96,7 +94,6 @@ public function installedVersion(string $package) /** * Get installed path of a specific package. * - * @param string $package * @return string */ public function installedPath(string $package) @@ -110,8 +107,6 @@ public function installedPath(string $package) /** * Require a package. * - * @param string $package - * @param string|null $version * @param mixed $extraParams */ public function require(string $package, string $version = null, ...$extraParams) @@ -129,9 +124,6 @@ public function require(string $package, string $version = null, ...$extraParams /** * Require a dev package. - * - * @param string $package - * @param string|null $version */ public function requireDev(string $package, string $version = null, ...$extraParams) { @@ -141,7 +133,6 @@ public function requireDev(string $package, string $version = null, ...$extraPar /** * Require multiple packages at once. * - * @param array $packages * @param mixed $extraParams */ public function requireMultiple(array $packages, ...$extraParams) @@ -156,7 +147,6 @@ public function requireMultiple(array $packages, ...$extraParams) /** * Require multiple dev packages at once. * - * @param array $packages * @param mixed $extraParams */ public function requireMultipleDev(array $packages, ...$extraParams) @@ -167,7 +157,6 @@ public function requireMultipleDev(array $packages, ...$extraParams) /** * Remove a package. * - * @param string $package * @param mixed $extraParams */ public function remove(string $package, ...$extraParams) @@ -178,7 +167,6 @@ public function remove(string $package, ...$extraParams) /** * Remove a dev package. * - * @param string $package * @param mixed $extraParams */ public function removeDev(string $package, ...$extraParams) @@ -189,7 +177,6 @@ public function removeDev(string $package, ...$extraParams) /** * Remove multiple packages at once. * - * @param array $packages * @param mixed $extraParams */ public function removeMultiple(array $packages, ...$extraParams) @@ -202,7 +189,6 @@ public function removeMultiple(array $packages, ...$extraParams) /** * Remove multiple dev packages at once. * - * @param array $packages * @param mixed $extraParams */ public function removeMultipleDev(array $packages, ...$extraParams) @@ -212,8 +198,6 @@ public function removeMultipleDev(array $packages, ...$extraParams) /** * Update a package. - * - * @param string $package */ public function update(string $package) { @@ -223,7 +207,6 @@ public function update(string $package) /** * Get cached output for package process. * - * @param string $package * @return mixed */ public function cachedOutput(string $package) @@ -234,7 +217,6 @@ public function cachedOutput(string $package) /** * Get cached output for last completed package process. * - * @param string $package * @return mixed */ public function lastCompletedCachedOutput(string $package) @@ -328,7 +310,6 @@ private function prepareProcessArguments($parts) /** * Sometimes composer returns versions with a 'v', sometimes it doesn't. * - * @param string $version * @return string */ private function normalizeVersion(string $version) @@ -350,7 +331,6 @@ private function getCacheKey($package) /** * Normalize packages array to require args, with version handling if `package => version` array structure is passed. * - * @param array $packages * @return array */ private function normalizePackagesArrayToRequireArgs(array $packages) diff --git a/src/Console/Processes/Process.php b/src/Console/Processes/Process.php index 94e292f05f..4f76f84f45 100644 --- a/src/Console/Processes/Process.php +++ b/src/Console/Processes/Process.php @@ -294,7 +294,6 @@ private function setCompletedOnCache($cacheKey) /** * Get cached output. * - * @param string $cacheKey * @return array */ public function cachedOutput(string $cacheKey) @@ -309,7 +308,6 @@ public function cachedOutput(string $cacheKey) /** * Get cached output for last completed process. * - * @param string $cacheKey * @return array */ public function lastCompletedCachedOutput(string $cacheKey) @@ -415,7 +413,6 @@ protected function newSymfonyProcess($command, $path = null) /** * Throw exception. * - * @param string $output * * @throws ProcessException */ diff --git a/src/Contracts/Assets/Asset.php b/src/Contracts/Assets/Asset.php index 9b4e6b1fd5..a15721fe7b 100644 --- a/src/Contracts/Assets/Asset.php +++ b/src/Contracts/Assets/Asset.php @@ -67,7 +67,6 @@ public function lastModified(); /** * Upload a file. * - * @param \Symfony\Component\HttpFoundation\File\UploadedFile $file * @return mixed */ public function upload(UploadedFile $file); diff --git a/src/Contracts/Config/Config.php b/src/Contracts/Config/Config.php index ad7b580b46..81816673b2 100644 --- a/src/Contracts/Config/Config.php +++ b/src/Contracts/Config/Config.php @@ -7,7 +7,6 @@ interface Config /** * Populate the config object with data. * - * @param array $config * @return void */ public function hydrate(array $config); diff --git a/src/Contracts/View/Antlers/Parser.php b/src/Contracts/View/Antlers/Parser.php index be5b4e5e60..6c7a9ba6da 100644 --- a/src/Contracts/View/Antlers/Parser.php +++ b/src/Contracts/View/Antlers/Parser.php @@ -69,7 +69,6 @@ public function getVariable($key, $context, $default = null); /** * Sets a render callback. * - * @param $callback * @return Parser */ public function callback($callback); diff --git a/src/Data/DataCollection.php b/src/Data/DataCollection.php index ba38070acf..a3a6dea716 100644 --- a/src/Data/DataCollection.php +++ b/src/Data/DataCollection.php @@ -17,7 +17,6 @@ class DataCollection extends IlluminateCollection /** * Limit a collection. * - * @param $limit * @return static */ public function limit($limit) diff --git a/src/Data/StoresScopedComputedFieldCallbacks.php b/src/Data/StoresScopedComputedFieldCallbacks.php index 1012121ce4..7d8025ce9b 100644 --- a/src/Data/StoresScopedComputedFieldCallbacks.php +++ b/src/Data/StoresScopedComputedFieldCallbacks.php @@ -13,8 +13,6 @@ trait StoresScopedComputedFieldCallbacks /** * @param string|array $scopes - * @param string $field - * @param Closure $callback */ public function computed($scopes, string $field, Closure $callback) { diff --git a/src/Events/ResponseCreated.php b/src/Events/ResponseCreated.php index 7df4e2eed2..f1fd9fa659 100644 --- a/src/Events/ResponseCreated.php +++ b/src/Events/ResponseCreated.php @@ -13,9 +13,6 @@ class ResponseCreated extends Event public $data; - /** - * @param Response $response - */ public function __construct(Response $response, $data) { $this->response = $response; diff --git a/src/Extend/Addon.php b/src/Extend/Addon.php index cc08ac7ff1..3f798eb5bf 100644 --- a/src/Extend/Addon.php +++ b/src/Extend/Addon.php @@ -168,7 +168,6 @@ public static function make($name) /** * Make an addon instance from package details. * - * @param array $package * @return self */ public static function makeFromPackage(array $package) diff --git a/src/Extensions/Pagination/Presenter.php b/src/Extensions/Pagination/Presenter.php index 15fd1275c0..bc319da325 100644 --- a/src/Extensions/Pagination/Presenter.php +++ b/src/Extensions/Pagination/Presenter.php @@ -41,7 +41,7 @@ private function getAllPages() while ($i <= $this->paginator->lastPage()) { $pages[] = [ 'page' => $i, - 'url' => $this->paginator->url($i), + 'url' => $this->paginator->url($i), ]; $i++; @@ -87,7 +87,7 @@ private function associative($array) foreach ($array as $key => $value) { $mapped[] = [ 'page' => $key, - 'url' => $value, + 'url' => $value, ]; } diff --git a/src/Facades/Endpoint/Path.php b/src/Facades/Endpoint/Path.php index af06f15290..4dd425a461 100644 --- a/src/Facades/Endpoint/Path.php +++ b/src/Facades/Endpoint/Path.php @@ -75,7 +75,6 @@ public function toUrl($path) * exist, PHP's realpath() won't work. Flysystem already has * a way to do this. Nice one. flysystem++ * - * @param $path * @return string */ public function resolve($path) @@ -137,7 +136,6 @@ public function isEntry($path) /** * Get the status of a $path. * - * @param $path * @return string */ public function status($path) diff --git a/src/Fields/Value.php b/src/Fields/Value.php index c3da52cfa9..2674930a9d 100644 --- a/src/Fields/Value.php +++ b/src/Fields/Value.php @@ -83,7 +83,7 @@ public function antlersValue(Parser $parser, $variables) $value = $this->value(); $shouldParseAntlers = $this->shouldParseAntlers(); - if ($value instanceof ArrayableString && $shouldParseAntlers) { + if ($value instanceof ArrayableString && $shouldParseAntlers) { $value = (string) $value; } diff --git a/src/Fieldtypes/Concerns/ResolvesStatamicUrls.php b/src/Fieldtypes/Concerns/ResolvesStatamicUrls.php index f916916b62..90eb25ae91 100644 --- a/src/Fieldtypes/Concerns/ResolvesStatamicUrls.php +++ b/src/Fieldtypes/Concerns/ResolvesStatamicUrls.php @@ -9,7 +9,6 @@ trait ResolvesStatamicUrls /** * Resolve `statamic://` URLs in string based markdown and html content. * - * @param string $content * @return string */ protected function resolveStatamicUrls(string $content) diff --git a/src/Fieldtypes/Date.php b/src/Fieldtypes/Date.php index 060c54873b..c0220df41c 100644 --- a/src/Fieldtypes/Date.php +++ b/src/Fieldtypes/Date.php @@ -72,13 +72,13 @@ protected function configFieldItems(): array [ 'display' => __('Timepicker'), 'fields' => [ - 'time_enabled' => [ + 'time_enabled' => [ 'display' => __('Time Enabled'), 'instructions' => __('statamic::fieldtypes.date.config.time_enabled'), 'type' => 'toggle', 'default' => false, ], - 'time_seconds_enabled' => [ + 'time_seconds_enabled' => [ 'display' => __('Show Seconds'), 'instructions' => __('statamic::fieldtypes.date.config.time_seconds_enabled'), 'type' => 'toggle', diff --git a/src/Fieldtypes/Sets.php b/src/Fieldtypes/Sets.php index ea3a8fb46d..bac456f7f6 100644 --- a/src/Fieldtypes/Sets.php +++ b/src/Fieldtypes/Sets.php @@ -90,8 +90,8 @@ public function preProcessConfig($sets) 'fields' => (new NestedFields)->preProcessConfig(array_get($config, 'fields', [])), ]); }) - ->values() - ->all(), + ->values() + ->all(), ]); })->values()->all(); } @@ -124,6 +124,6 @@ public function process($tabs) ], ]; }) - ->all(); + ->all(); } } diff --git a/src/Forms/Email.php b/src/Forms/Email.php index ff1451614c..1c6f429d8c 100644 --- a/src/Forms/Email.php +++ b/src/Forms/Email.php @@ -133,14 +133,14 @@ protected function addData() $augmented = $this->submission->toAugmentedArray(); $data = array_merge($augmented, $this->getGlobalsData(), [ - 'config' => config()->all(), - 'fields' => $this->getRenderableFieldData(Arr::except($augmented, ['id', 'date', 'form'])), - 'site_url' => Config::getSiteUrl(), - 'date' => now(), - 'now' => now(), - 'today' => now(), - 'site' => $this->site->handle(), - 'locale' => $this->site->handle(), + 'config' => config()->all(), + 'fields' => $this->getRenderableFieldData(Arr::except($augmented, ['id', 'date', 'form'])), + 'site_url' => Config::getSiteUrl(), + 'date' => now(), + 'now' => now(), + 'today' => now(), + 'site' => $this->site->handle(), + 'locale' => $this->site->handle(), ]); return $this->with($data); diff --git a/src/Forms/JsDrivers/AbstractJsDriver.php b/src/Forms/JsDrivers/AbstractJsDriver.php index 60a7d6141b..075f621f65 100644 --- a/src/Forms/JsDrivers/AbstractJsDriver.php +++ b/src/Forms/JsDrivers/AbstractJsDriver.php @@ -13,7 +13,6 @@ abstract class AbstractJsDriver implements JsDriver /** * Instantiate JS driver. * - * @param Form $form * @param array $options */ public function __construct(Form $form, $options = []) diff --git a/src/Forms/Metrics/AbstractMetric.php b/src/Forms/Metrics/AbstractMetric.php index 8777d4dbe7..21d8760be0 100644 --- a/src/Forms/Metrics/AbstractMetric.php +++ b/src/Forms/Metrics/AbstractMetric.php @@ -21,7 +21,6 @@ abstract class AbstractMetric implements Metric /** * Create a new Metric. * - * @param Form $form * @param array $config */ public function __construct(Form $form, $config = []) diff --git a/src/Forms/Widget.php b/src/Forms/Widget.php index 6786ab3b0f..29db9e3a79 100644 --- a/src/Forms/Widget.php +++ b/src/Forms/Widget.php @@ -23,11 +23,11 @@ public function html() } return view('statamic::forms.widget', [ - 'form' => $form, - 'format' => $this->config('date_format', $form->dateFormat()), - 'fields' => $this->config('fields', []), + 'form' => $form, + 'format' => $this->config('date_format', $form->dateFormat()), + 'fields' => $this->config('fields', []), 'submissions' => collect($form->submissions())->reverse()->take((int) $this->config('limit', 5))->toArray(), - 'title' => $this->config('title', $form->title()), + 'title' => $this->config('title', $form->title()), ]); } } diff --git a/src/Git/Git.php b/src/Git/Git.php index e4627e8cec..3417d7017b 100644 --- a/src/Git/Git.php +++ b/src/Git/Git.php @@ -256,7 +256,6 @@ protected function push($gitRoot) /** * Shell escape string for use in git commands. * - * @param string $string * @return string */ protected function shellEscape(string $string) diff --git a/src/GraphQL/Types/AssetContainerType.php b/src/GraphQL/Types/AssetContainerType.php index 0044a0d2ec..2cea98d498 100644 --- a/src/GraphQL/Types/AssetContainerType.php +++ b/src/GraphQL/Types/AssetContainerType.php @@ -26,8 +26,7 @@ public function fields(): array $arr['resolve'] = $this->resolver(); return $arr; - }) - ->all(); + })->all(); } private function resolver() diff --git a/src/GraphQL/Types/CollectionType.php b/src/GraphQL/Types/CollectionType.php index 3573463ac6..efad6b0524 100644 --- a/src/GraphQL/Types/CollectionType.php +++ b/src/GraphQL/Types/CollectionType.php @@ -25,16 +25,13 @@ public function fields(): array 'structure' => [ 'type' => GraphQL::type(CollectionStructureType::NAME), ], - ]) - ->merge(collect(GraphQL::getExtraTypeFields($this->name))->map(function ($closure) { + ])->merge(collect(GraphQL::getExtraTypeFields($this->name))->map(function ($closure) { return $closure(); - })) - ->map(function (array $arr) { + }))->map(function (array $arr) { $arr['resolve'] = $arr['resolve'] ?? $this->resolver(); return $arr; - }) - ->all(); + })->all(); } private function resolver() diff --git a/src/GraphQL/Types/FormType.php b/src/GraphQL/Types/FormType.php index 4fc3343468..f7182ad835 100644 --- a/src/GraphQL/Types/FormType.php +++ b/src/GraphQL/Types/FormType.php @@ -38,13 +38,11 @@ public function fields(): array return $form->blueprint()->fields()->validator()->rules(); }, ], - ]) - ->map(function (array $arr) { + ])->map(function (array $arr) { $arr['resolve'] = $arr['resolve'] ?? $this->resolver(); return $arr; - }) - ->all(); + })->all(); } private function resolver() diff --git a/src/GraphQL/Types/StructureType.php b/src/GraphQL/Types/StructureType.php index 2878e4dfac..fa4205dc3c 100644 --- a/src/GraphQL/Types/StructureType.php +++ b/src/GraphQL/Types/StructureType.php @@ -36,8 +36,7 @@ public function fields(): array $arr['resolve'] = $this->resolver(); return $arr; - }) - ->all(); + })->all(); } private function resolver() diff --git a/src/GraphQL/Types/TaxonomyType.php b/src/GraphQL/Types/TaxonomyType.php index 1dc8ec1e3a..e9a588ed52 100644 --- a/src/GraphQL/Types/TaxonomyType.php +++ b/src/GraphQL/Types/TaxonomyType.php @@ -27,7 +27,7 @@ public function fields(): array return $arr; }) - ->all(); + ->all(); } private function resolver() diff --git a/src/Http/Controllers/CP/Assets/ThumbnailController.php b/src/Http/Controllers/CP/Assets/ThumbnailController.php index c4293ff736..d69c4e0aba 100644 --- a/src/Http/Controllers/CP/Assets/ThumbnailController.php +++ b/src/Http/Controllers/CP/Assets/ThumbnailController.php @@ -43,10 +43,6 @@ class ThumbnailController extends Controller */ protected $mutex; - /** - * @param Server $server - * @param ImageGenerator $generator - */ public function __construct(Server $server, ImageGenerator $generator) { $this->server = $server; diff --git a/src/Http/Controllers/CP/CpController.php b/src/Http/Controllers/CP/CpController.php index a53d922b0a..31d6c28d06 100644 --- a/src/Http/Controllers/CP/CpController.php +++ b/src/Http/Controllers/CP/CpController.php @@ -24,8 +24,6 @@ class CpController extends Controller /** * Create a new CpController. - * - * @param \Illuminate\Http\Request $request */ public function __construct(Request $request) { diff --git a/src/Http/Controllers/CP/DashboardController.php b/src/Http/Controllers/CP/DashboardController.php index 190e72c2a7..cd4f8c66a6 100644 --- a/src/Http/Controllers/CP/DashboardController.php +++ b/src/Http/Controllers/CP/DashboardController.php @@ -11,7 +11,6 @@ class DashboardController extends CpController /** * View for the CP dashboard. * - * @param Loader $loader * @return mixed */ public function index(Loader $loader) diff --git a/src/Http/Controllers/CP/Preferences/PreferenceController.php b/src/Http/Controllers/CP/Preferences/PreferenceController.php index e41f337752..15f7fb589a 100644 --- a/src/Http/Controllers/CP/Preferences/PreferenceController.php +++ b/src/Http/Controllers/CP/Preferences/PreferenceController.php @@ -21,8 +21,6 @@ public function index() /** * Store a user preference. - * - * @param Request $request */ public function store(Request $request) { diff --git a/src/Http/Controllers/CP/Updater/UpdaterController.php b/src/Http/Controllers/CP/Updater/UpdaterController.php index 53850180c7..5609acb792 100644 --- a/src/Http/Controllers/CP/Updater/UpdaterController.php +++ b/src/Http/Controllers/CP/Updater/UpdaterController.php @@ -35,8 +35,6 @@ public function index(Licenses $licenses) /** * Updates count. - * - * @param Request $request */ public function count(Request $request) { diff --git a/src/Http/Controllers/GlideController.php b/src/Http/Controllers/GlideController.php index fbdf00a775..902663862f 100644 --- a/src/Http/Controllers/GlideController.php +++ b/src/Http/Controllers/GlideController.php @@ -34,9 +34,6 @@ class GlideController extends Controller /** * GlideController constructor. - * - * @param \League\Glide\Server $server - * @param \Illuminate\Http\Request $request */ public function __construct(Server $server, Request $request) { @@ -108,8 +105,6 @@ public function generateByAsset($encoded) /** * Generate an image. * - * @param $type - * @param $item * @return mixed */ private function generateBy($type, $item) diff --git a/src/Http/Controllers/UserController.php b/src/Http/Controllers/UserController.php index 51040ba221..3436dd171e 100644 --- a/src/Http/Controllers/UserController.php +++ b/src/Http/Controllers/UserController.php @@ -152,7 +152,7 @@ public function password(Request $request) $validator = Validator::make($request->all(), [ 'current_password' => ['required', 'current_password'], - 'password' => ['required', 'confirmed', Password::default()], + 'password' => ['required', 'confirmed', Password::default()], ]); if ($validator->fails()) { diff --git a/src/Http/Middleware/CP/Configurable.php b/src/Http/Middleware/CP/Configurable.php index 4a67281cfc..93e9ada780 100644 --- a/src/Http/Middleware/CP/Configurable.php +++ b/src/Http/Middleware/CP/Configurable.php @@ -11,7 +11,6 @@ class Configurable * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/src/Http/Middleware/CP/RedirectIfAuthorized.php b/src/Http/Middleware/CP/RedirectIfAuthorized.php index 2855e627ba..4c13190864 100644 --- a/src/Http/Middleware/CP/RedirectIfAuthorized.php +++ b/src/Http/Middleware/CP/RedirectIfAuthorized.php @@ -11,7 +11,6 @@ class RedirectIfAuthorized * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @param string|null $guard * @return mixed */ diff --git a/src/Http/Middleware/DisableFloc.php b/src/Http/Middleware/DisableFloc.php index 90f8c7f591..61a66e9dec 100644 --- a/src/Http/Middleware/DisableFloc.php +++ b/src/Http/Middleware/DisableFloc.php @@ -10,7 +10,6 @@ class DisableFloc * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/src/Http/Middleware/PoweredByHeader.php b/src/Http/Middleware/PoweredByHeader.php index b5975b5d05..20a229abb2 100644 --- a/src/Http/Middleware/PoweredByHeader.php +++ b/src/Http/Middleware/PoweredByHeader.php @@ -11,7 +11,6 @@ class PoweredByHeader * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/src/Http/Middleware/RedirectIfAuthenticated.php b/src/Http/Middleware/RedirectIfAuthenticated.php index 3219c442c1..e4190e9bd1 100644 --- a/src/Http/Middleware/RedirectIfAuthenticated.php +++ b/src/Http/Middleware/RedirectIfAuthenticated.php @@ -11,7 +11,6 @@ class RedirectIfAuthenticated * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @param string|null $guard * @return mixed */ diff --git a/src/Imaging/GlideImageManipulator.php b/src/Imaging/GlideImageManipulator.php index 3be9e4e59b..31a468d1f7 100644 --- a/src/Imaging/GlideImageManipulator.php +++ b/src/Imaging/GlideImageManipulator.php @@ -81,9 +81,6 @@ class GlideImageManipulator implements ImageManipulator */ protected $params = []; - /** - * @param UrlBuilder $builder - */ public function __construct(UrlBuilder $builder) { $this->builder = $builder; @@ -181,7 +178,6 @@ public function __call($method, $args) } /** - * @param $value * @return $this */ public function width($value) diff --git a/src/Imaging/GlideManager.php b/src/Imaging/GlideManager.php index 74dfc2d842..e8bc1d84c8 100644 --- a/src/Imaging/GlideManager.php +++ b/src/Imaging/GlideManager.php @@ -21,10 +21,10 @@ class GlideManager public function server(array $config = []) { return ServerFactory::create(array_merge([ - 'source' => base_path(), // this gets overridden on the fly by the image generator - 'cache' => $this->cacheDisk()->getDriver(), + 'source' => base_path(), // this gets overridden on the fly by the image generator + 'cache' => $this->cacheDisk()->getDriver(), 'response' => new LaravelResponseFactory(app('request')), - 'driver' => Config::get('statamic.assets.image_manipulation.driver'), + 'driver' => Config::get('statamic.assets.image_manipulation.driver'), 'cache_with_file_extensions' => true, 'presets' => Image::manipulationPresets(), 'watermarks' => public_path(), diff --git a/src/Imaging/GlideUrlBuilder.php b/src/Imaging/GlideUrlBuilder.php index 6b7e993bef..4f65693cc6 100644 --- a/src/Imaging/GlideUrlBuilder.php +++ b/src/Imaging/GlideUrlBuilder.php @@ -15,9 +15,6 @@ class GlideUrlBuilder extends ImageUrlBuilder */ protected $options; - /** - * @param array $options - */ public function __construct(array $options = []) { $this->options = $options; diff --git a/src/Imaging/ImageGenerator.php b/src/Imaging/ImageGenerator.php index 60efbd0b74..0970e14043 100644 --- a/src/Imaging/ImageGenerator.php +++ b/src/Imaging/ImageGenerator.php @@ -47,8 +47,6 @@ class ImageGenerator /** * GlideController constructor. - * - * @param \League\Glide\Server $server */ public function __construct(Server $server) { @@ -80,7 +78,6 @@ public function setParams(array $params) * Generate a manipulated image by a path. * * @param string $path - * @param array $params * @return mixed */ public function generateByPath($path, array $params) @@ -107,7 +104,6 @@ private function doGenerateByPath($path, array $params) * Generate a manipulated image by a URL. * * @param string $url - * @param array $params * @return mixed */ public function generateByUrl($url, array $params) @@ -136,7 +132,6 @@ private function doGenerateByUrl($url, array $params) * Generate a manipulated image by an asset. * * @param \Statamic\Contracts\Assets\Asset $asset - * @param array $params * @return mixed */ public function generateByAsset($asset, array $params) diff --git a/src/Imaging/PresetGenerator.php b/src/Imaging/PresetGenerator.php index e1214e9107..1ec950ad73 100644 --- a/src/Imaging/PresetGenerator.php +++ b/src/Imaging/PresetGenerator.php @@ -11,9 +11,6 @@ class PresetGenerator */ private $generator; - /** - * @param ImageGenerator $generator - */ public function __construct(ImageGenerator $generator) { $this->generator = $generator; diff --git a/src/Imaging/StaticUrlBuilder.php b/src/Imaging/StaticUrlBuilder.php index 1767f30bce..de9e4f9f37 100644 --- a/src/Imaging/StaticUrlBuilder.php +++ b/src/Imaging/StaticUrlBuilder.php @@ -33,10 +33,6 @@ class StaticUrlBuilder extends ImageUrlBuilder */ protected $options; - /** - * @param ImageGenerator $generator - * @param array $options - */ public function __construct(ImageGenerator $generator, array $options = []) { $this->generator = $generator; diff --git a/src/Jobs/RunComposer.php b/src/Jobs/RunComposer.php index c7eb6bf61d..78287babb8 100644 --- a/src/Jobs/RunComposer.php +++ b/src/Jobs/RunComposer.php @@ -29,7 +29,6 @@ class RunComposer implements ShouldQueue /** * Create a new job instance. * - * @param string $cacheKey * @param string|array $params * @return void */ diff --git a/src/Listeners/GeneratePresetImageManipulations.php b/src/Listeners/GeneratePresetImageManipulations.php index 2d7feacc5f..2f864296eb 100644 --- a/src/Listeners/GeneratePresetImageManipulations.php +++ b/src/Listeners/GeneratePresetImageManipulations.php @@ -14,9 +14,6 @@ class GeneratePresetImageManipulations implements ShouldQueue */ private $generator; - /** - * @param PresetGenerator $generator - */ public function __construct(PresetGenerator $generator) { $this->generator = $generator; diff --git a/src/Listeners/UpdateAssetReferences.php b/src/Listeners/UpdateAssetReferences.php index 0df996c215..a82bf44d56 100644 --- a/src/Listeners/UpdateAssetReferences.php +++ b/src/Listeners/UpdateAssetReferences.php @@ -36,8 +36,6 @@ public function subscribe($events) /** * Handle the asset saved event. - * - * @param AssetSaved $event */ public function handleSaved(AssetSaved $event) { @@ -50,8 +48,6 @@ public function handleSaved(AssetSaved $event) /** * Handle the asset replaced event. - * - * @param AssetReplaced $event */ public function handleReplaced(AssetReplaced $event) { @@ -64,8 +60,6 @@ public function handleReplaced(AssetReplaced $event) /** * Handle the asset deleted event. - * - * @param AssetDeleted $event */ public function handleDeleted(AssetDeleted $event) { diff --git a/src/Listeners/UpdateTermReferences.php b/src/Listeners/UpdateTermReferences.php index d03ce7a611..308f5f3542 100644 --- a/src/Listeners/UpdateTermReferences.php +++ b/src/Listeners/UpdateTermReferences.php @@ -34,8 +34,6 @@ public function subscribe($events) /** * Handle the term saved event. - * - * @param TermSaved $event */ public function handleSaved(TermSaved $event) { @@ -48,8 +46,6 @@ public function handleSaved(TermSaved $event) /** * Handle the term deleted event. - * - * @param TermDeleted $event */ public function handleDeleted(TermDeleted $event) { diff --git a/src/Modifiers/CoreModifiers.php b/src/Modifiers/CoreModifiers.php index 4d3803c63a..b1096cb80a 100644 --- a/src/Modifiers/CoreModifiers.php +++ b/src/Modifiers/CoreModifiers.php @@ -77,7 +77,6 @@ public function addQueryParam($value, $params) /** * Returns a string with backslashes added before characters that need to be escaped. * - * @param $value * @return string */ public function addSlashes($value) @@ -119,7 +118,6 @@ public function antlers($value, $params, $context) /** * Alias an array variable. * - * @param $value * @param array $params * @return array|void */ @@ -149,8 +147,6 @@ public function ascii($value) /** * Returns the character at given index $param[0], starting from 0. * - * @param $value - * @param $params * @return string */ public function at($value, $params) @@ -161,7 +157,6 @@ public function at($value, $params) /** * Returns a focal point as a background-position CSS value. * - * @param $value * @return string */ public function backgroundPosition($value) @@ -192,7 +187,6 @@ public function backspace($value, $params) /** * Converts a bard value to a flat array of nodes and marks. * - * @param $value * @return array */ public function bardItems($value) @@ -219,7 +213,6 @@ public function bardItems($value) /** * Converts a bard value to plain text (excluding sets). * - * @param $value * @return string */ public function bardText($value) @@ -246,7 +239,6 @@ public function bardText($value) /** * Converts a bard value to HTML (excluding sets). * - * @param $value * @return string */ public function bardHtml($value) @@ -277,7 +269,6 @@ public function boolString($value) * capitalizes letters following digits, spaces, dashes and underscores, * and removes spaces, dashes, as well as underscores. * - * @param $value * @return string */ public function camelize($value) @@ -288,7 +279,6 @@ public function camelize($value) /** * Wraps a value in CDATA tags for RSS/XML feeds. * - * @param $value * @return string */ public function cdata($value) @@ -299,7 +289,6 @@ public function cdata($value) /** * Rounds a number up to the next whole number. * - * @param $value * @return int */ public function ceil($value) @@ -354,7 +343,6 @@ public function collapse($value) * a single space. This includes tabs and newline characters, as well as * multibyte whitespace such as the thin space and ideographic space. * - * @param $value * @return string */ public function collapseWhitespace($value) @@ -366,8 +354,6 @@ public function collapseWhitespace($value) * Converts a comma-separated list of variable names into an array. * * @param string $value - * @param $params - * @param $context * @return array */ public function compact($value, $params, $context) @@ -438,8 +424,6 @@ public function containsAll($value, $params, $context) /** * Returns true if the string contains all needles ($params), false otherwise. Case-insensitive. * - * @param $value - * @param $params * @return bool */ public function containsAny($value, $params) @@ -466,8 +450,6 @@ public function count($value) * Returns the number of occurrences of $params[0] in the given string. By default, * the comparison is case-insensitive, but can be made sensitive by setting $params[1] to true. * - * @param $value - * @param $params * @return int */ public function countSubstring($value, $params) @@ -480,7 +462,6 @@ public function countSubstring($value, $params) * characters (with the exception if the first character of the string), and in * place of spaces as well as underscores. * - * @param $value * @return string */ public function dashify($value) @@ -502,8 +483,6 @@ public function daysAgo($value, $params) /** * Dump, Die, and Debug using Ignition. - * - * @param $value */ public function ddd($value) { @@ -512,8 +491,6 @@ public function ddd($value) /** * Dump a var into the Debug bar for data exploration. - * - * @param $value */ public function debug($value) { @@ -534,7 +511,6 @@ public function decode($value) /** * Replaces hyphens and underscores with spaces. * - * @param $value * @return string */ public function deslugify($value) @@ -545,8 +521,6 @@ public function deslugify($value) /** * Divides values with some science. Context aware. * - * @param $value - * @param $params * @return mixed */ public function divide($value, $params, $context) @@ -557,8 +531,6 @@ public function divide($value, $params, $context) /** * Turn an array into an definition list. * - * @param $value - * @param $params * @return string */ public function dl($value, $params) @@ -568,8 +540,6 @@ public function dl($value, $params) /** * Dump and die the output of a variable. - * - * @param $value */ public function dd($value) { @@ -578,8 +548,6 @@ function_exists('ddd') ? ddd($value) : dd($value); /** * Dump a variable. - * - * @param $value */ public function dump($value) { @@ -590,8 +558,6 @@ public function dump($value) * Returns true if the string ends with a given substring, false otherwise. * The comparison is case-insensitive. * - * @param $value - * @param $params * @return bool */ public function endsWith($value, $params) @@ -603,8 +569,6 @@ public function endsWith($value, $params) * Ensures that the string begins with a specified string. * If it doesn't, it's prepended. * - * @param $value - * @param $params * @return string */ public function ensureLeft($value, $params) @@ -615,8 +579,6 @@ public function ensureLeft($value, $params) /** * Ensures that the string ends with a specified string. If it doesn't, it's appended. * - * @param $value - * @param $params * @return string */ public function ensureRight($value, $params) @@ -639,8 +601,6 @@ public function entities($value) * Breaks a string at a given marker. * Uses by default. * - * @param $value - * @param $params * @return array|false|string */ public function excerpt($value, $params) @@ -669,7 +629,6 @@ public function explode($value, $params) /** * Returns the file extension of a given filename. * - * @param $value * @return string */ public function extension($value) @@ -680,7 +639,6 @@ public function extension($value) /** * Generate a link to a Favicon file. * - * @param $value * @return string */ public function favicon($value) @@ -691,8 +649,6 @@ public function favicon($value) /** * Returns the first $params[0] characters of a string, or the first element of an array. * - * @param $value - * @param $params * @return string */ public function first($value, $params) @@ -707,7 +663,6 @@ public function first($value, $params) /** * Flattens a multi-dimensional collection into a single dimension. * - * @param $value * @return array */ public function flatten($value) @@ -729,7 +684,6 @@ public function flip($value) /** * Rounds a number down to the next whole number. * - * @param $value * @return int */ public function floor($value) @@ -740,8 +694,6 @@ public function floor($value) /** * Converts a string to a Carbon instance and formats it according to the whim of the Overlord. * - * @param $value - * @param $params * @return string */ public function format($value, $params) @@ -752,8 +704,6 @@ public function format($value, $params) /** * Returns a converted string in a Carbon translated format. * - * @param $value - * @param $params * @return string */ public function formatTranslated($value, $params) @@ -764,8 +714,6 @@ public function formatTranslated($value, $params) /** * Format a number with grouped thousands and decimal points. * - * @param $value - * @param $params * @return string */ public function formatNumber($value, $params) @@ -782,7 +730,6 @@ public function formatNumber($value, $params) /** * Replace /absolute/urls with http://domain.com/urls. * - * @param $value * @return string */ public function fullUrls($value) @@ -797,8 +744,6 @@ public function fullUrls($value) /** * Get any variable from a relationship. * - * @param $value - * @param $params * @return string */ public function get($value, $params) @@ -840,8 +785,6 @@ public function get($value, $params) /** * Get a Gravatar image URL from an email. * - * @param $value - * @param $params * @return string */ public function gravatar($value, $params) @@ -852,8 +795,6 @@ public function gravatar($value, $params) /** * Groups the collection's items by a given key. * - * @param $value - * @param $params * @return Collection */ public function groupBy($value, $params) @@ -960,7 +901,6 @@ public function hasUpperCase($value) * Get the date difference in hours. * * @param Carbon $value - * @param $params * @return int */ public function hoursAgo($value, $params) @@ -971,8 +911,6 @@ public function hoursAgo($value, $params) /** * Generate an HTML image element. * - * @param $value - * @param $params * @return string */ public function image($value, $params) @@ -984,8 +922,6 @@ public function image($value, $params) * Turn an array into a string and glue together with a delimiter. * Joinplode because join and implode are existing PHP methods. Obviously. * - * @param $value - * @param $params * @return string */ public function joinplode($value, $params) @@ -1011,7 +947,6 @@ public function joinplode($value, $params) * Check if an item exists in an array using "dot" notation. * * @param $value - * @param $params * @return bool */ public function inArray($haystack, $params, $context) @@ -1036,8 +971,6 @@ public function inArray($haystack, $params, $context) /** * Inserts $substring into the string at the $position provided. * - * @param $value - * @param $params * @return string */ public function insert($value, $params) @@ -1051,9 +984,6 @@ public function insert($value, $params) /** * Determines if the date is after another specified date ($params[0]). * - * @param $value - * @param $params - * @param $context * @return bool */ public function isAfter($value, $params, $context) @@ -1064,7 +994,6 @@ public function isAfter($value, $params, $context) /** * Returns true if the string contains only alphabetic chars, false otherwise. * - * @param $value * @return bool */ public function isAlpha($value) @@ -1075,7 +1004,6 @@ public function isAlpha($value) /** * Returns true if the string contains only alphabetic and numeric chars, false otherwise. * - * @param $value * @return bool */ public function isAlphanumeric($value) @@ -1086,7 +1014,6 @@ public function isAlphanumeric($value) /** * Returns true if the value is an array. * - * @param $value * @return bool */ public function isArray($value) @@ -1097,9 +1024,6 @@ public function isArray($value) /** * Determines if the date is before another specified date ($params[0]). * - * @param $value - * @param $params - * @param $context * @return bool */ public function isBefore($value, $params, $context) @@ -1110,9 +1034,6 @@ public function isBefore($value, $params, $context) /** * Determines if the date is between two other specified dates, $params[0] and $params[1]. * - * @param $value - * @param $params - * @param $context * @return bool */ public function isBetween($value, $params, $context) @@ -1126,7 +1047,6 @@ public function isBetween($value, $params, $context) /** * Returns true if the string contains only whitespace chars, false otherwise. * - * @param $value * @return bool */ public function isBlank($value) @@ -1137,7 +1057,6 @@ public function isBlank($value) /** * Return true if the string is an email address. * - * @param $value * @return bool */ public function isEmail($value) @@ -1169,7 +1088,6 @@ public function isEmpty($value) /** * Determines if the date is in the future, ie. greater (after) than now. * - * @param $value * @return bool */ public function isFuture($value) @@ -1180,7 +1098,6 @@ public function isFuture($value) /** * Returns true if the value is iterable. * - * @param $value * @return bool */ public function isIterable($value) @@ -1191,7 +1108,6 @@ public function isIterable($value) /** * Returns true if the string is JSON, false otherwise. * - * @param $value * @return bool */ public function isJson($value) @@ -1202,7 +1118,6 @@ public function isJson($value) /** * Determines if the date in a leap year. * - * @param $value * @return bool */ public function isLeapYear($value) @@ -1213,7 +1128,6 @@ public function isLeapYear($value) /** * Returns true if the string contains only lowercase chars, false otherwise. * - * @param $value * @return bool */ public function isLowercase($value) @@ -1224,7 +1138,6 @@ public function isLowercase($value) /** * Finds whether a value is a number or a numeric string. * - * @param $value * @return bool */ public function isNumeric($value) @@ -1235,7 +1148,6 @@ public function isNumeric($value) /** * Determines if the date is in the past, ie. less (before) than now. * - * @param $value * @return bool */ public function isPast($value) @@ -1246,7 +1158,6 @@ public function isPast($value) /** * Determines if the date is today. * - * @param $value * @return bool */ public function isToday($value) @@ -1257,7 +1168,6 @@ public function isToday($value) /** * Returns true if the string contains only uppercase chars, false otherwise. * - * @param $value * @return bool */ public function isUppercase($value) @@ -1268,7 +1178,6 @@ public function isUppercase($value) /** * Returns true if the string is a URL. * - * @param $value * @return bool */ public function isUrl($value) @@ -1279,7 +1188,6 @@ public function isUrl($value) /** * Returns true if the string is an external URL. * - * @param $value * @return bool */ public function isExternalUrl($value) @@ -1290,7 +1198,6 @@ public function isExternalUrl($value) /** * Determines if the date on a weekday. * - * @param $value * @return bool */ public function isWeekday($value) @@ -1301,7 +1208,6 @@ public function isWeekday($value) /** * Determines if the date on a weekend. * - * @param $value * @return bool */ public function isWeekend($value) @@ -1312,7 +1218,6 @@ public function isWeekend($value) /** * Determines if the date is yesterday. * - * @param $value * @return bool */ public function isYesterday($value) @@ -1323,7 +1228,6 @@ public function isYesterday($value) /** * Determines if the date is tomorrow. * - * @param $value * @return bool */ public function isTomorrow($value) @@ -1334,7 +1238,6 @@ public function isTomorrow($value) /** * Converts a string to kebab-case. * - * @param $value * @return string */ public function kebab($value) @@ -1345,8 +1248,6 @@ public function kebab($value) /** * Rekeys an array or collection. * - * @param $value - * @param $params * @return string */ public function keyBy($value, $params) @@ -1359,8 +1260,6 @@ public function keyBy($value, $params) /** * Returns the last $params[0] characters of a string, or the last element of an array. * - * @param $value - * @param $params * @return string */ public function last($value, $params) @@ -1375,7 +1274,6 @@ public function last($value, $params) /** * Converts the first character of the supplied string to lower case. * - * @param $value * @return string */ public function lcfirst($value) @@ -1386,7 +1284,6 @@ public function lcfirst($value) /** * Get the items in an array or characters in a string. * - * @param $value * @return int */ public function length($value) @@ -1423,8 +1320,6 @@ public function limit($value, $params) /** * Generate an HTML link. * - * @param $value - * @param $params * @return string */ public function link($value, $params) @@ -1439,7 +1334,6 @@ public function link($value, $params) * Converts all characters in the string to lowercase. Multi-byte friendly. * * - * @param $value * @return string */ public function lower($value) @@ -1450,7 +1344,6 @@ public function lower($value) /** * Replace a var with a localized string. * - * @param $value * @return string */ public function localize($value) @@ -1461,7 +1354,6 @@ public function localize($value) /** * Rough macro prototype that only uses CoreModifiers. * - * @param $value * @param array $params * @param array $context * @return mixed @@ -1482,7 +1374,6 @@ public function macro($value, $params, $context) /** * Wraps matched words with tags. * - * @param $value * @param array $params * @return string */ @@ -1503,8 +1394,6 @@ public function mark($value, $params, $context) /** * Generate a HTML link to an email address. * - * @param $value - * @param $params * @return string */ public function mailto($value, $params) @@ -1515,7 +1404,6 @@ public function mailto($value, $params) /** * Parse content as Markdown. * - * @param $value * @param array $params * @return mixed */ @@ -1533,9 +1421,6 @@ public function markdown($value, $params) /** * Merge an array variable with another array variable. * - * @param $value - * @param $params - * @param $context * @return array */ public function merge($value, $params, $context) @@ -1548,7 +1433,6 @@ public function merge($value, $params, $context) /** * Generate an md5 hash of a value. * - * @param $value * @param $params * @return string */ @@ -1561,7 +1445,6 @@ public function md5($value) * Get the date difference in minutes. * * @param Carbon $value - * @param $params * @return int */ public function minutesAgo($value, $params) @@ -1572,9 +1455,6 @@ public function minutesAgo($value, $params) /** * Performs modulus division on a value. Context aware. * - * @param $value - * @param $params - * @param $context * @return int */ public function mod($value, $params, $context) @@ -1589,8 +1469,6 @@ public function mod($value, $params, $context) * * @link http://php.net/manual/en/function.strtotime.php * - * @param $value - * @param $params * @return \DateTime */ public function modifyDate($value, $params) @@ -1602,7 +1480,6 @@ public function modifyDate($value, $params) * Get the date difference in months. * * @param Carbon $value - * @param $params * @return int */ public function monthsAgo($value, $params) @@ -1613,9 +1490,6 @@ public function monthsAgo($value, $params) /** * Multiplies values together with a little help from science. Context aware. * - * @param $value - * @param $params - * @param $context * @return float|int */ public function multiply($value, $params, $context) @@ -1626,7 +1500,6 @@ public function multiply($value, $params, $context) /** * It's kinda neat! * - * @param $value * @return string */ public function neatify($value) @@ -1637,7 +1510,6 @@ public function neatify($value) /** * Replaces line breaks with
tags. * - * @param $value * @return string */ public function nl2br($value) @@ -1648,7 +1520,6 @@ public function nl2br($value) /** * Is it or is it not numberwang? * - * @param $value * @return bool */ public function isNumberwang($value) @@ -1659,7 +1530,6 @@ public function isNumberwang($value) /** * Obfuscate a string to prevent spam-bots from sniffing it. * - * @param $value * @return string */ public function obfuscate($value) @@ -1670,7 +1540,6 @@ public function obfuscate($value) /** * Obfuscate an e-mail address to prevent spam-bots from sniffing it. * - * @param $value * @return string */ public function obfuscateEmail($value) @@ -1733,7 +1602,6 @@ public function offset($value, $params) /** * Get the output of an Asset, useful for SVGs. * - * @param $value * @return array|mixed|null|void */ public function output($value) @@ -1752,7 +1620,6 @@ public function output($value) /** * Get a path component. * - * @param $value * @return string */ public function pathinfo($value, $params) @@ -1760,10 +1627,10 @@ public function pathinfo($value, $params) $key = Arr::get($params, 0); $component = $key ? [ - 'dirname' => PATHINFO_DIRNAME, - 'basename' => PATHINFO_BASENAME, + 'dirname' => PATHINFO_DIRNAME, + 'basename' => PATHINFO_BASENAME, 'extension' => PATHINFO_EXTENSION, - 'filename' => PATHINFO_FILENAME, + 'filename' => PATHINFO_FILENAME, ][$key] : (defined('PATHINFO_ALL') ? PATHINFO_ALL : 15); return pathinfo($value, $component); @@ -1838,7 +1705,6 @@ public function plural($value, $params, $context) /** * Return a random value from an array. * - * @param $value * @return string */ public function random($value) @@ -1849,7 +1715,6 @@ public function random($value) /** * URL-encode according to RFC 3986. * - * @param $value * @return string */ public function rawurlencode($value) @@ -1860,7 +1725,6 @@ public function rawurlencode($value) /** * Send data to Laravel Ray. * - * @param $value * @return void */ public function ray($value) @@ -1875,8 +1739,6 @@ public function ray($value) /** * Estimate the read time based on a given number of words per minute. * - * @param $value - * @param $params * @return int */ public function readTime($value, $params) @@ -1889,7 +1751,6 @@ public function readTime($value, $params) /** * Wraps regex matches with tags. * - * @param $value * @param array $params * @return string */ @@ -1918,8 +1779,6 @@ public function regexMark($value, $params) /** * Replaces all occurrences of pattern $params[0] with the string $params[1]. * - * @param $value - * @param $params * @return string */ public function regexReplace($value, $params) @@ -1930,8 +1789,6 @@ public function regexReplace($value, $params) /** * Alias of `diff_for_humans`. * - * @param $value - * @param $params * @return string */ public function relative($value, $params) @@ -1943,8 +1800,6 @@ public function relative($value, $params) * Format date in an easier for humans to read format. * Send $params[1] as true to turn off modifiers "ago", "from now", etc. * - * @param $value - * @param $params * @return string */ public function diffForHumans($value, $params) @@ -1958,8 +1813,6 @@ public function diffForHumans($value, $params) * Format date in an easier for owls to read format. * For whoever gives a hoot. * - * @param $value - * @param $params * @return string */ public function diffForOwls($value, $params) @@ -1970,8 +1823,6 @@ public function diffForOwls($value, $params) /** * Returns a new string with the prefix $params[0] removed, if present. * - * @param $value - * @param $params * @return string */ public function removeLeft($value, $params) @@ -2014,8 +1865,6 @@ public function removeQueryParam($value, $params) /** * Returns a new string with the suffix $params[0] removed, if present. * - * @param $value - * @param $params * @return string */ public function removeRight($value, $params) @@ -2026,9 +1875,6 @@ public function removeRight($value, $params) /** * Repeats value a given number of times. * - * @param $value - * @param $params - * @param $context * @return string */ public function repeat($value, $params, $context) @@ -2046,8 +1892,6 @@ public function repeat($value, $params, $context) /** * Replaces all occurrences of a search in $params[0] by $params[1]. * - * @param $value - * @param $params * @return string */ public function replace($value, $params) @@ -2081,8 +1925,6 @@ public function reverse($value) /** * Rounds a number to a specified precision (number of digits after the decimal point). * - * @param $value - * @param $params * @return float */ public function round($value, $params) @@ -2096,8 +1938,6 @@ public function round($value, $params) * the string is further truncated so that the substring may be * appended without exceeding the desired length. * - * @param $value - * @param $params * @return string */ public function safeTruncate($value, $params) @@ -2108,7 +1948,6 @@ public function safeTruncate($value, $params) /** * Convert special characters to HTML entities with htmlspecialchars. * - * @param $value * @return string */ public function sanitize($value, $params) @@ -2172,7 +2011,6 @@ public function segment($value, $params, $context) * Get the date difference in seconds. * * @param Carbon $value - * @param $params * @return int */ public function secondsAgo($value, $params) @@ -2274,7 +2112,6 @@ public function shuffle($value, array $params) /** * Get the singular form of an English word. * - * @param $value * @return string */ public function singular($value) @@ -2289,7 +2126,6 @@ public function singular($value) * The replacement defaults to a single dash, and the string is also * converted to lowercase. * - * @param $value * @return string */ public function slugify($value) @@ -2300,7 +2136,6 @@ public function slugify($value) /** * Parse with SmartyPants. Aren't you fancy? * - * @param $value * @return string */ public function smartypants($value) @@ -2311,7 +2146,6 @@ public function smartypants($value) /** * Converts a string to snake_case. * - * @param $value * @return string */ public function snake($value) @@ -2357,7 +2191,6 @@ public function sort($value, $params) /** * Strip whitespace from HTML. * - * @param $value * @return string */ public function spaceless($value) @@ -2371,8 +2204,6 @@ public function spaceless($value) /** * Break an array into a given number of groups. * - * @param $value - * @param $params * @return array */ public function split($value, $params) @@ -2392,8 +2223,6 @@ public function split($value, $params) * Returns true if the string starts with a given substring ($params[0]), false otherwise. * The comparison is case-insensitive. * - * @param $value - * @param $params * @return bool */ public function startsWith($value, $params) @@ -2404,9 +2233,6 @@ public function startsWith($value, $params) /** * Strip tags from a string, allowing for an explicit list. Context aware. * - * @param $value - * @param $params - * @param $context * @return string */ public function stripTags($value, $params, $context) @@ -2427,7 +2253,6 @@ public function stripTags($value, $params, $context) * * @param string $value The value to be modified. * @param array $params Any parameters used in the modifier. - * @return string */ public function strPad(string $value, array $params): string { @@ -2445,7 +2270,6 @@ public function strPad(string $value, array $params): string * * @param string $value The value to be modified. * @param array $params Any parameters used in the modifier. - * @return string */ public function strPadBoth(string $value, array $params): string { @@ -2459,7 +2283,6 @@ public function strPadBoth(string $value, array $params): string * * @param string $value The value to be modified. * @param array $params Any parameters used in the modifier. - * @return string */ public function strPadLeft(string $value, array $params): string { @@ -2473,7 +2296,6 @@ public function strPadLeft(string $value, array $params): string * * @param string $value The value to be modified. * @param array $params Any parameters used in the modifier. - * @return string */ public function strPadRight(string $value, array $params): string { @@ -2483,7 +2305,6 @@ public function strPadRight(string $value, array $params): string /** * Converts a string to StudlyCase. * - * @param $value * @return string */ public function studly($value) @@ -2494,9 +2315,6 @@ public function studly($value) /** * Subtracts values with the help of science. Context aware. * - * @param $value - * @param $params - * @param $context * @return int|float */ public function subtract($value, $params, $context) @@ -2509,8 +2327,6 @@ public function subtract($value, $params, $context) * It differs from the mb_substr() function in that providing a length of * null will return the rest of the string, rather than an empty string. * - * @param $value - * @param $params * @return string */ public function substr($value, $params) @@ -2521,7 +2337,6 @@ public function substr($value, $params) /** * Returns the sum of all items in the array, optionally by specific key. * - * @param $value * @param array $params * @return mixed */ @@ -2550,8 +2365,6 @@ public function sum($value, $params) /** * Surrounds a string with substring $params[0]. * - * @param $value - * @param $params * @return string */ public function surround($value, $params) @@ -2562,7 +2375,6 @@ public function surround($value, $params) /** * Returns a case swapped version of the string. * - * @param $value * @return string */ public function swapCase($value) @@ -2573,8 +2385,6 @@ public function swapCase($value) /** * Convert an array of data from the Table fieldtype into a basic HTML table. * - * @param $value - * @param $params * @return string */ public function table($value, $params) @@ -2603,7 +2413,6 @@ public function table($value, $params) * Returns a string with smart quotes, ellipsis characters, and dashes from * Windows-1252 (commonly used in Word documents) replaced by their ASCII equivalents. * - * @param $value * @return string */ public function tidy($value) @@ -2614,7 +2423,6 @@ public function tidy($value) /** * Converts the first character of each word in the string to uppercase. * - * @param $value * @return string */ public function title($value) @@ -2629,8 +2437,6 @@ public function title($value) /** * Convert value to a boolean. * - * @param $params - * @param $value * @return bool */ public function toBool($value, $params) @@ -2645,8 +2451,6 @@ public function toBool($value, $params) /** * Converts the data to json. * - * @param $value - * @param $params * @return string */ public function toJson($value, $params) @@ -2668,8 +2472,6 @@ public function toJson($value, $params) * Converts each tab in the string to some number of spaces, as defined by * $param[0]. By default, each tab is converted to 4 consecutive spaces. * - * @param $value - * @param $params * @return string */ public function toSpaces($value, $params) @@ -2686,8 +2488,6 @@ public function toString($value) * Converts each occurrence of some consecutive number of spaces, as defined by * $param[0], to a tab. By default, each 4 consecutive spaces are converted to a tab. * - * @param $value - * @param $params * @return string */ public function toTabs($value, $params) @@ -2698,7 +2498,6 @@ public function toTabs($value, $params) /** * Translates a string. * - * @param $value * @return string */ public function trans($value) @@ -2709,9 +2508,6 @@ public function trans($value) /** * Translates and pluralizes a string. * - * @param $value - * @param $params - * @param $context * @return string */ public function transChoice($value, $params, $context) @@ -2724,7 +2520,6 @@ public function transChoice($value, $params, $context) /** * Returns the trimmed string. * - * @param $value * @return string */ public function trim($value) @@ -2737,8 +2532,6 @@ public function trim($value) * truncating occurs, the string is further truncated so that the substring * may be appended without exceeding the desired length. * - * @param $value - * @param $params * @return string */ public function truncate($value, $params) @@ -2783,7 +2576,6 @@ public function typeOf($value) /** * Converts the first character of the supplied string to upper case. * - * @param $value * @return string */ public function ucfirst($value) @@ -2806,7 +2598,6 @@ public function ul($value, $params) /** * Decodes URL-encoded string. * - * @param $value * @return string */ public function urldecode($value) @@ -2817,7 +2608,6 @@ public function urldecode($value) /** * URL-encodes string. * - * @param $value * @return string */ public function urlencode($value) @@ -2830,7 +2620,6 @@ public function urlencode($value) * Underscores are inserted before uppercase characters (with the exception * of the first character of the string), and in place of spaces as well as dashes. * - * @param $value * @return string */ public function underscored($value) @@ -2841,7 +2630,6 @@ public function underscored($value) /** * Transform a value into uppercase. Multi-byte friendly. * - * @param $value * @return string */ public function upper($value) @@ -2852,7 +2640,6 @@ public function upper($value) /** * Returns all of the unique-by-key items in the array. * - * @param $value * @param array $params * @return array */ @@ -2864,7 +2651,6 @@ public function unique($value, $params) /** * Get the URL from an ID. * - * @param $value * @return string */ public function url($value) @@ -2881,7 +2667,6 @@ public function url($value) /** * Get a URL component. * - * @param $value * @return string */ public function parse_url($value, $params) @@ -2889,13 +2674,13 @@ public function parse_url($value, $params) $key = Arr::get($params, 0); $component = $key ? [ - 'scheme' => PHP_URL_SCHEME, - 'host' => PHP_URL_HOST, - 'port' => PHP_URL_PORT, - 'user' => PHP_URL_USER, - 'pass' => PHP_URL_PASS, - 'path' => PHP_URL_PATH, - 'query' => PHP_URL_QUERY, + 'scheme' => PHP_URL_SCHEME, + 'host' => PHP_URL_HOST, + 'port' => PHP_URL_PORT, + 'user' => PHP_URL_USER, + 'pass' => PHP_URL_PASS, + 'path' => PHP_URL_PATH, + 'query' => PHP_URL_QUERY, 'fragment' => PHP_URL_FRAGMENT, ][$key] : -1; @@ -2906,7 +2691,6 @@ public function parse_url($value, $params) * Get the date difference in weeks. * * @param Carbon $value - * @param $params * @return int */ public function weeksAgo($value, $params) @@ -2953,7 +2737,6 @@ public function widont($value, $params) /** * Wraps an HTML tag around the value. * - * @param $value * @return string */ public function wrap($value, $params) @@ -2978,7 +2761,6 @@ public function wrap($value, $params) /** * Count the number of words in a string. * - * @param $value * @return mixed */ public function wordCount($value) @@ -2993,7 +2775,6 @@ public function wordCount($value) * Get the date difference in years. * * @param Carbon $value - * @param $params * @return int */ public function yearsAgo($value, $params) @@ -3096,8 +2877,6 @@ public function isEmbeddable($url) /** * Converts a string to a Carbon instance and formats it with ISO formats. * - * @param $value - * @param $params * @return string */ public function isoFormat($value, $params) @@ -3110,7 +2889,6 @@ public function isoFormat($value, $params) /** * Takes a modifier array, split on ":", and formats it for HTML attribute key:value pairs. * - * @param $params * @param string $delimiter * @return array */ diff --git a/src/Modifiers/Modify.php b/src/Modifiers/Modify.php index c77c21d755..417ec755fd 100644 --- a/src/Modifiers/Modify.php +++ b/src/Modifiers/Modify.php @@ -26,8 +26,6 @@ class Modify implements \IteratorAggregate /** * Instantiate fluent modifier helper. - * - * @param Loader $loader */ public function __construct(Loader $loader) { diff --git a/src/OAuth/Provider.php b/src/OAuth/Provider.php index c9589287a9..c59bf50d9b 100644 --- a/src/OAuth/Provider.php +++ b/src/OAuth/Provider.php @@ -48,7 +48,6 @@ public function findOrCreateUser($socialite): StatamicUser * Create a Statamic user from a Socialite user. * * @param SocialiteUser $socialite - * @return StatamicUser */ public function createUser($socialite): StatamicUser { diff --git a/src/Preferences/HasPreferences.php b/src/Preferences/HasPreferences.php index 95c19c258f..bf6525298e 100644 --- a/src/Preferences/HasPreferences.php +++ b/src/Preferences/HasPreferences.php @@ -136,7 +136,6 @@ public function hasPreference($key) * Modify a preference using a callback. * * @param string $key - * @param Closure $callback * @return $this */ public function modifyPreference($key, Closure $callback) diff --git a/src/Providers/AddonServiceProvider.php b/src/Providers/AddonServiceProvider.php index d2409a20ec..a344f4e104 100644 --- a/src/Providers/AddonServiceProvider.php +++ b/src/Providers/AddonServiceProvider.php @@ -14,7 +14,6 @@ use Statamic\Extend\Manifest; use Statamic\Facades\Addon; use Statamic\Facades\Fieldset; -use Statamic\Facades\File; use Statamic\Fields\Fieldtype; use Statamic\Forms\JsDrivers\JsDriver; use Statamic\Modifiers\Modifier; diff --git a/src/Providers/IgnitionServiceProvider.php b/src/Providers/IgnitionServiceProvider.php index 1e43cf8db4..6353b8aa2c 100644 --- a/src/Providers/IgnitionServiceProvider.php +++ b/src/Providers/IgnitionServiceProvider.php @@ -19,7 +19,7 @@ public function register() { try { $this->app->make(SolutionProviderRepository::class) - ->registerSolutionProviders($this->providers); + ->registerSolutionProviders($this->providers); } catch (BindingResolutionException $e) { // } diff --git a/src/Query/OrderBy.php b/src/Query/OrderBy.php index 16c85cfa00..10bacaab59 100644 --- a/src/Query/OrderBy.php +++ b/src/Query/OrderBy.php @@ -9,9 +9,6 @@ class OrderBy /** * Instantiate order by object. - * - * @param string $sort - * @param string $direction */ public function __construct(string $sort, string $direction) { @@ -28,7 +25,6 @@ public function __construct(string $sort, string $direction) /** * Instantiate order by object. * - * @param string $orderBy * @return static */ public static function parse(string $orderBy) diff --git a/src/Routing/UrlBuilder.php b/src/Routing/UrlBuilder.php index 3c1484816c..9120c8dc0a 100644 --- a/src/Routing/UrlBuilder.php +++ b/src/Routing/UrlBuilder.php @@ -37,7 +37,6 @@ public function merge(array $merged) } /** - * @param $route * @return string * * @throws \Statamic\Exceptions\InvalidEntryTypeException diff --git a/src/Search/Comb/Comb.php b/src/Search/Comb/Comb.php index f4fb46337a..234f7a5e9c 100644 --- a/src/Search/Comb/Comb.php +++ b/src/Search/Comb/Comb.php @@ -434,8 +434,8 @@ private function prepareData() array_push($output, $record); } - // find categorized data } else { + // find categorized data foreach ($this->haystack as $category => $records) { foreach ($records as $item) { $record = (array) $item; @@ -493,8 +493,8 @@ private function searchOverData($params, $raw_query) // search return that no results were found if ($params['required']) { throw new NoResultsFound('No results found.'); - // otherwise, the haystack is empty and that's an error } else { + // otherwise, the haystack is empty and that's an error throw new CombException('Empty haystack.'); } } @@ -667,8 +667,9 @@ private function searchOverData($params, $raw_query) $output = $categorized_output; - // or trim outputs to limit if it was set } elseif ($this->limit) { + // or trim outputs to limit if it was set + // if we do not want more results than the limit if ($this->enable_too_many_results && count($output) > $this->limit) { throw new TooManyResults('Too many results found.'); @@ -677,8 +678,8 @@ private function searchOverData($params, $raw_query) $output = array_slice($output, 0, $this->limit); $output_length = count($output); - // otherwise, the size is the size } else { + // otherwise, the size is the size $output_length = count($output); } @@ -870,8 +871,8 @@ private function parseSearchParameters($query) array_push($parts['chunks'], $query); } - // perform a boolean search -- require words, disallow words } elseif ($this->query_mode === self::QUERY_BOOLEAN) { + // perform a boolean search -- require words, disallow words $words = preg_split("/\s+/i", $query); if ($this->use_alternates) { @@ -903,8 +904,8 @@ private function parseSearchParameters($query) array_push($parts['chunks'], $query); } - // search for the entire query as one thing } else { + // search for the entire query as one thing $parts['chunks'] = [strtolower($query)]; } @@ -949,29 +950,34 @@ private function getAlternateWords($words) foreach ($words as $word) { if (strtolower($word) == 'and') { array_push($output, '&'); + continue; } if ($word == '&') { array_push($output, 'and'); + continue; } if (strpos($word, "'") !== false) { array_push($output, preg_replace("/'/", '‘', $word)); array_push($output, preg_replace("/'/", '’', $word)); + continue; } if (strpos($word, '’') !== false) { array_push($output, preg_replace('/’/', '‘', $word)); array_push($output, preg_replace('/’/', "'", $word)); + continue; } if (strpos($word, '‘') !== false) { array_push($output, preg_replace('/‘/', "'", $word)); array_push($output, preg_replace('/‘/', '’', $word)); + continue; } } diff --git a/src/Search/QueryBuilder.php b/src/Search/QueryBuilder.php index bb8c6e236a..100f7acf83 100644 --- a/src/Search/QueryBuilder.php +++ b/src/Search/QueryBuilder.php @@ -66,9 +66,7 @@ public function getBaseItems() ->setRawResult($raw = $results[$result->getReference()]) ->setScore($raw['search_score'] ?? null); }); - }) - ->sortByDesc->getScore() - ->values(); + })->sortByDesc->getScore()->values(); } protected function collect($items = []) diff --git a/src/Search/Searchables/Assets.php b/src/Search/Searchables/Assets.php index 51f1341126..bc70922cac 100644 --- a/src/Search/Searchables/Assets.php +++ b/src/Search/Searchables/Assets.php @@ -49,11 +49,11 @@ public function find(array $keys): Collection return compact('container', 'path'); }) - ->groupBy->container - ->flatMap(fn ($group, $container) => Asset::query() - ->where('container', $container) - ->whereIn('path', $group->map->path->all()) - ->get() - ); + ->groupBy->container + ->flatMap(fn ($group, $container) => Asset::query() + ->where('container', $container) + ->whereIn('path', $group->map->path->all()) + ->get() + ); } } diff --git a/src/Stache/Repositories/EntryRepository.php b/src/Stache/Repositories/EntryRepository.php index 6d28608e5f..e125e500ef 100644 --- a/src/Stache/Repositories/EntryRepository.php +++ b/src/Stache/Repositories/EntryRepository.php @@ -52,9 +52,9 @@ public function findByUri(string $uri, string $site = null): ?Entry } $entry = $this->query() - ->where('uri', $uri) - ->where('site', $site) - ->first(); + ->where('uri', $uri) + ->where('site', $site) + ->first(); if (! $entry) { return null; diff --git a/src/StarterKits/Installer.php b/src/StarterKits/Installer.php index 9b22bf6cb3..1692d83654 100644 --- a/src/StarterKits/Installer.php +++ b/src/StarterKits/Installer.php @@ -34,9 +34,7 @@ final class Installer /** * Instantiate starter kit installer. * - * @param string $package * @param mixed $console - * @param LicenseManager|null $licenseManager */ public function __construct(string $package, $console = null, LicenseManager $licenseManager = null) { @@ -50,14 +48,12 @@ public function __construct(string $package, $console = null, LicenseManager $li /** * Instantiate starter kit installer. * - * @param string $package * @param mixed $console - * @param LicenseManager|null $licenseManager * @return static */ public static function package(string $package, $console = null, LicenseManager $licenseManager = null) { - return new static($package, $console, $licenseManager); + return new self($package, $console, $licenseManager); } /** @@ -726,7 +722,6 @@ protected function starterKitPath($path = null) * * TODO: Move to trait and reuse in MakeAddon? * - * @param string $output * @return string */ private function outputFromSymfonyProcess(string $output) @@ -872,7 +867,6 @@ protected function installableDependencies($configKey) /** * Normalize packages array to require args, with version handling if `package => version` array structure is passed. * - * @param array $packages * @return array */ private function normalizePackagesArrayToRequireArgs(array $packages) diff --git a/src/StarterKits/LicenseManager.php b/src/StarterKits/LicenseManager.php index c3f696b96e..cf360fe9c9 100644 --- a/src/StarterKits/LicenseManager.php +++ b/src/StarterKits/LicenseManager.php @@ -18,7 +18,6 @@ final class LicenseManager /** * Instantiate starter kit license manager. * - * @param string $package * @param string|null $licenseKey * @param mixed $console */ @@ -32,14 +31,13 @@ public function __construct(string $package, $licenseKey = null, $console = null /** * Instantiate starter kit license manager. * - * @param string $package * @param string|null $licenceKey * @param mixed $console * @return static */ public static function validate(string $package, $licenceKey = null, $console = null) { - return (new static($package, $licenceKey, $console))->performValidation(); + return (new self($package, $licenceKey, $console))->performValidation(); } /** @@ -185,7 +183,6 @@ private function setValid() /** * Output info message. * - * @param string $message * @return $this */ private function info(string $message) @@ -198,7 +195,6 @@ private function info(string $message) /** * Output error message. * - * @param string $message * @return $this */ private function error(string $message) @@ -211,7 +207,6 @@ private function error(string $message) /** * Output comment line. * - * @param string $message * @return $this */ private function comment(string $message) diff --git a/src/StaticCaching/Cacher.php b/src/StaticCaching/Cacher.php index c62318893a..cd8751fe95 100644 --- a/src/StaticCaching/Cacher.php +++ b/src/StaticCaching/Cacher.php @@ -17,7 +17,6 @@ public function cachePage(Request $request, $content); /** * Check if a page has been cached. * - * @param Request $request * @return bool */ public function hasCachedPage(Request $request); @@ -25,7 +24,6 @@ public function hasCachedPage(Request $request); /** * Get a cached page. * - * @param Request $request * @return string */ public function getCachedPage(Request $request); diff --git a/src/StaticCaching/Cachers/AbstractCacher.php b/src/StaticCaching/Cachers/AbstractCacher.php index c6999765bd..1fced8bf7e 100644 --- a/src/StaticCaching/Cachers/AbstractCacher.php +++ b/src/StaticCaching/Cachers/AbstractCacher.php @@ -22,9 +22,6 @@ abstract class AbstractCacher implements Cacher */ private $config; - /** - * @param Repository $cache - */ public function __construct(Repository $cache, $config) { $this->cache = $cache; @@ -135,7 +132,6 @@ public function cacheDomain($domain = null) /** * Get the URL from a request. * - * @param Request $request * @return string */ public function getUrl(Request $request) diff --git a/src/StaticCaching/Cachers/ApplicationCacher.php b/src/StaticCaching/Cachers/ApplicationCacher.php index 6fb648e7f2..8bae8dd027 100644 --- a/src/StaticCaching/Cachers/ApplicationCacher.php +++ b/src/StaticCaching/Cachers/ApplicationCacher.php @@ -50,7 +50,6 @@ public function cachePage(Request $request, $content) /** * Check if a page has been cached. * - * @param Request $request * @return bool */ public function hasCachedPage(Request $request) @@ -61,7 +60,6 @@ public function hasCachedPage(Request $request) /** * Get a cached page. * - * @param Request $request * @return string */ public function getCachedPage(Request $request) diff --git a/src/StaticCaching/Cachers/FileCacher.php b/src/StaticCaching/Cachers/FileCacher.php index e1f4701c7a..7f06c761f7 100644 --- a/src/StaticCaching/Cachers/FileCacher.php +++ b/src/StaticCaching/Cachers/FileCacher.php @@ -34,8 +34,6 @@ class FileCacher extends AbstractCacher private $nocachePlaceholder; /** - * @param Writer $writer - * @param Repository $cache * @param array $config */ public function __construct(Writer $writer, Repository $cache, $config) @@ -71,7 +69,6 @@ public function cachePage(Request $request, $content) } /** - * @param \Illuminate\Http\Request $request * @return string */ public function getCachedPage(Request $request) @@ -158,7 +155,6 @@ public function getCachePath($site = null) /** * Get the path to the cached file. * - * @param $url * @return string */ public function getFilePath($url, $site = null) diff --git a/src/StaticCaching/Middleware/Cache.php b/src/StaticCaching/Middleware/Cache.php index 14dfc03494..ed97dd4c1d 100644 --- a/src/StaticCaching/Middleware/Cache.php +++ b/src/StaticCaching/Middleware/Cache.php @@ -37,7 +37,6 @@ public function __construct(Cacher $cacher, Session $nocache) * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) diff --git a/src/StaticCaching/UrlExcluder.php b/src/StaticCaching/UrlExcluder.php index a4a471f146..713145a50b 100644 --- a/src/StaticCaching/UrlExcluder.php +++ b/src/StaticCaching/UrlExcluder.php @@ -8,7 +8,6 @@ interface UrlExcluder * Determine whether URL should be excluded from caching. * * @param string $url Url. - * @return bool */ public function isExcluded(string $url): bool; } diff --git a/src/Structures/TreeBuilder.php b/src/Structures/TreeBuilder.php index a45a60eaf9..1ab105cf7f 100644 --- a/src/Structures/TreeBuilder.php +++ b/src/Structures/TreeBuilder.php @@ -86,23 +86,23 @@ protected function transformTreeForController($tree) $collection = $page->collection(); return [ - 'id' => $page->id(), - 'entry' => $page->reference(), - 'title' => $page->hasCustomTitle() ? $page->title() : null, + 'id' => $page->id(), + 'entry' => $page->reference(), + 'title' => $page->hasCustomTitle() ? $page->title() : null, 'entry_title' => $page->referenceExists() ? $page->entry()->value('title') : null, - 'url' => $page->referenceExists() ? null : $page->url(), - 'edit_url' => $page->editUrl(), - 'can_delete' => $page->referenceExists() ? User::current()->can('delete', $page->entry()) : true, - 'slug' => $page->slug(), - 'status' => $page->referenceExists() ? $page->status() : null, - 'redirect' => $page->referenceExists() ? $page->entry()->get('redirect') : null, - 'collection' => ! $collection ? null : [ + 'url' => $page->referenceExists() ? null : $page->url(), + 'edit_url' => $page->editUrl(), + 'can_delete' => $page->referenceExists() ? User::current()->can('delete', $page->entry()) : true, + 'slug' => $page->slug(), + 'status' => $page->referenceExists() ? $page->status() : null, + 'redirect' => $page->referenceExists() ? $page->entry()->get('redirect') : null, + 'collection' => ! $collection ? null : [ 'handle' => $collection->handle(), 'title' => $collection->title(), 'edit_url' => $collection->showUrl(), 'create_url' => $collection->createEntryUrl(), ], - 'children' => (! empty($item['children'])) ? $this->transformTreeForController($item['children']) : [], + 'children' => (! empty($item['children'])) ? $this->transformTreeForController($item['children']) : [], ]; })->values()->all(); } diff --git a/src/Support/Arr.php b/src/Support/Arr.php index 0fba011492..e522ee1963 100644 --- a/src/Support/Arr.php +++ b/src/Support/Arr.php @@ -73,7 +73,6 @@ public static function addScope($array, $scope) /** * Checks if an array is associative. * - * @param $array * @return bool */ public static function assoc($array) @@ -84,7 +83,6 @@ public static function assoc($array) /** * Deep merges arrays better than array_merge_recursive(). * - * @param array $array1 * @param array $array2 * @return array */ diff --git a/src/Support/FileCollection.php b/src/Support/FileCollection.php index a21f982292..48774f29e4 100644 --- a/src/Support/FileCollection.php +++ b/src/Support/FileCollection.php @@ -198,21 +198,21 @@ public function toArray() $gb = number_format($size / 1073741824, 2); $data[] = [ - 'file' => URL::format($path), // Todo: This will only work when using the local file adapter - 'filename' => $pathinfo['filename'], - 'extension' => array_get($pathinfo, 'extension'), - 'basename' => array_get($pathinfo, 'basename'), - 'size' => File::sizeHuman($path), - 'size_bytes' => $size, + 'file' => URL::format($path), // Todo: This will only work when using the local file adapter + 'filename' => $pathinfo['filename'], + 'extension' => array_get($pathinfo, 'extension'), + 'basename' => array_get($pathinfo, 'basename'), + 'size' => File::sizeHuman($path), + 'size_bytes' => $size, 'size_kilobytes' => $kb, 'size_megabytes' => $mb, 'size_gigabytes' => $gb, - 'size_b' => $size, - 'size_kb' => $kb, - 'size_mb' => $kb, - 'size_gb' => $kb, - 'is_file' => File::isImage($path), - 'last_modified' => Carbon::createFromTimestamp(File::lastModified($path)), + 'size_b' => $size, + 'size_kb' => $kb, + 'size_mb' => $kb, + 'size_gb' => $kb, + 'is_file' => File::isImage($path), + 'last_modified' => Carbon::createFromTimestamp(File::lastModified($path)), ]; } diff --git a/src/Support/FluentGetterSetter.php b/src/Support/FluentGetterSetter.php index 07b930e9ae..f73082a3fd 100644 --- a/src/Support/FluentGetterSetter.php +++ b/src/Support/FluentGetterSetter.php @@ -29,7 +29,6 @@ public function __construct($object, $property) /** * Define custom getter logic. * - * @param Closure $callback * @return $this */ public function getter(Closure $callback) diff --git a/src/Support/Html.php b/src/Support/Html.php index 09c24dc0c1..0a0f8733be 100644 --- a/src/Support/Html.php +++ b/src/Support/Html.php @@ -66,7 +66,6 @@ protected static function attributeElement($key, $value) /** * Transform the string to an Html serializable object. * - * @param $html * @return \Illuminate\Support\HtmlString */ protected static function toHtmlString($html) @@ -123,8 +122,6 @@ public static function ul($list, $attributes = []) /** * Generate a description list of items. * - * @param array $list - * @param array $attributes * @return \Illuminate\Support\HtmlString */ public static function dl(array $list, array $attributes = []) @@ -266,7 +263,6 @@ public static function link($url, $title = null, $attributes = []) * Parse each text part of an HTML string (no tags) through a callback function. * * @param string $value - * @param Closure $callback * @return string */ public static function mapText($value, Closure $callback) diff --git a/src/Support/Str.php b/src/Support/Str.php index 490f93a96c..33fb2a2a61 100644 --- a/src/Support/Str.php +++ b/src/Support/Str.php @@ -195,7 +195,6 @@ public static function widont($value, $words = 1) // step 4, re-replace the code from step 1 with spaces return str_replace('%###%##%', ' ', $value); - // otherwise } else { return preg_replace_callback("/([^\s]\s)([^\s]*\s?){{$words}}$/im", function ($matches) { return preg_replace("/([\s])/", ' ', rtrim($matches[0])); @@ -219,7 +218,6 @@ public static function compare($str1, $str2) * * @param string $value * @param string $regex - * @param Closure $callback * @return string */ public static function mapRegex($value, $regex, Closure $callback) @@ -266,9 +264,6 @@ public static function tailwindWidthClass($width) /** * Output either literal "true" or "false" strings given a boolean. - * - * @param bool $value - * @return string */ public static function bool(bool $value): string { @@ -279,7 +274,6 @@ public static function bool(bool $value): string * Get an actual boolean from a string based boolean. * * @param mixed $value - * @return bool */ public static function toBool($value): bool { diff --git a/src/Tags/Asset.php b/src/Tags/Asset.php index f0f04318e0..0d346f976f 100644 --- a/src/Tags/Asset.php +++ b/src/Tags/Asset.php @@ -19,8 +19,6 @@ class Asset extends Assets * If the variable contains an array of IDs, we'll use only the first. * To iterate over multiple assets, use {{ assets:[variable }} instead. * - * @param $method - * @param $arguments * @return string */ public function __call($method, $arguments) diff --git a/src/Tags/Assets.php b/src/Tags/Assets.php index b2f442e685..b1d3c396b6 100644 --- a/src/Tags/Assets.php +++ b/src/Tags/Assets.php @@ -25,8 +25,6 @@ class Assets extends Tags * {{ url }}, etc * {{ /asset:[variable] }} * - * @param $method - * @param $arguments * @return string */ public function __call($method, $arguments) @@ -126,7 +124,6 @@ protected function filterByFields($entry) } /** - * @param $value * @return \Illuminate\Support\Collection|mixed|null */ protected function filterByType($value) @@ -186,7 +183,7 @@ protected function assets($urls) $this->assets->supplement(function ($asset) { return [ - 'width' => $asset->width(), + 'width' => $asset->width(), 'height' => $asset->height(), ]; }); diff --git a/src/Tags/Concerns/OutputsItems.php b/src/Tags/Concerns/OutputsItems.php index 54ceef9c70..000b3de6cf 100644 --- a/src/Tags/Concerns/OutputsItems.php +++ b/src/Tags/Concerns/OutputsItems.php @@ -54,14 +54,14 @@ protected function getPaginationResultsKey() protected function getPaginationData($paginator) { return [ - 'total_items' => $paginator->total(), + 'total_items' => $paginator->total(), 'items_per_page' => $paginator->perPage(), - 'total_pages' => $paginator->lastPage(), - 'current_page' => $paginator->currentPage(), - 'prev_page' => $paginator->previousPageUrl(), - 'next_page' => $paginator->nextPageUrl(), - 'auto_links' => $paginator->render('pagination::default'), - 'links' => $paginator->renderArray(), + 'total_pages' => $paginator->lastPage(), + 'current_page' => $paginator->currentPage(), + 'prev_page' => $paginator->previousPageUrl(), + 'next_page' => $paginator->nextPageUrl(), + 'auto_links' => $paginator->render('pagination::default'), + 'links' => $paginator->renderArray(), ]; } } diff --git a/src/Tags/FluentTag.php b/src/Tags/FluentTag.php index f5c9a18594..83c04d41c1 100644 --- a/src/Tags/FluentTag.php +++ b/src/Tags/FluentTag.php @@ -35,8 +35,6 @@ class FluentTag implements \IteratorAggregate, \ArrayAccess /** * Instantiate fluent tag helper. - * - * @param Loader $loader */ public function __construct(Loader $loader) { @@ -109,11 +107,11 @@ public function fetch() debugbar()->startMeasure($profileTagName, $tagName); $tag = app(Loader::class)->load($name, [ - 'parser' => null, - 'params' => $this->params, - 'content' => '', - 'context' => $this->context, - 'tag' => $tagName, + 'parser' => null, + 'params' => $this->params, + 'content' => '', + 'context' => $this->context, + 'tag' => $tagName, 'tag_method' => $originalMethod, ]); diff --git a/src/Tags/Structure.php b/src/Tags/Structure.php index 0ab5b6eb15..bdaecf2708 100644 --- a/src/Tags/Structure.php +++ b/src/Tags/Structure.php @@ -130,15 +130,15 @@ public function toArray($tree, $parent = null, $depth = 1) $absoluteUrl = $page->absoluteUrl(); return array_merge($data, [ - 'children' => $children, - 'parent' => $parent, - 'depth' => $depth, - 'index' => $index, - 'count' => $index + 1, - 'first' => $index === 0, - 'last' => $index === count($tree) - 1, - 'is_current' => ! is_null($url) && rtrim($url, '/') === rtrim($this->currentUrl, '/'), - 'is_parent' => ! is_null($url) && $this->siteAbsoluteUrl !== $absoluteUrl && URL::isAncestorOf($this->currentUrl, $url), + 'children' => $children, + 'parent' => $parent, + 'depth' => $depth, + 'index' => $index, + 'count' => $index + 1, + 'first' => $index === 0, + 'last' => $index === count($tree) - 1, + 'is_current' => ! is_null($url) && rtrim($url, '/') === rtrim($this->currentUrl, '/'), + 'is_parent' => ! is_null($url) && $this->siteAbsoluteUrl !== $absoluteUrl && URL::isAncestorOf($this->currentUrl, $url), 'is_external' => URL::isExternal((string) $absoluteUrl), ]); })->filter()->values(); diff --git a/src/Taxonomies/LocalizedTerm.php b/src/Taxonomies/LocalizedTerm.php index 3f8bbbc8b7..57cdc57922 100644 --- a/src/Taxonomies/LocalizedTerm.php +++ b/src/Taxonomies/LocalizedTerm.php @@ -33,16 +33,7 @@ use Statamic\Statamic; use Statamic\Support\Str; -class LocalizedTerm implements - Term, - Responsable, - Augmentable, - Protectable, - ResolvesValuesContract, - ArrayAccess, - Arrayable, - ContainsQueryableValues, - SearchableContract +class LocalizedTerm implements Term, Responsable, Augmentable, Protectable, ResolvesValuesContract, ArrayAccess, Arrayable, ContainsQueryableValues, SearchableContract { use Revisable, Routable, Publishable, HasAugmentedInstance, TracksQueriedColumns, TracksQueriedRelations, TracksLastModified, ContainsSupplementalData, ResolvesValues, Searchable; diff --git a/src/Taxonomies/TermReferenceUpdater.php b/src/Taxonomies/TermReferenceUpdater.php index 8200694b5f..de7e3df923 100644 --- a/src/Taxonomies/TermReferenceUpdater.php +++ b/src/Taxonomies/TermReferenceUpdater.php @@ -20,7 +20,6 @@ class TermReferenceUpdater extends DataReferenceUpdater /** * Filter by taxonomy. * - * @param string $taxonomy * @return $this */ public function filterByTaxonomy(string $taxonomy) diff --git a/src/Taxonomies/TermTracker.php b/src/Taxonomies/TermTracker.php index 43e750de09..dda688c177 100644 --- a/src/Taxonomies/TermTracker.php +++ b/src/Taxonomies/TermTracker.php @@ -20,9 +20,6 @@ class TermTracker */ private $taxonomyStache; - /** - * @param Stache $stache - */ public function __construct(Stache $stache) { $this->stache = $stache; @@ -40,9 +37,6 @@ public function subscribe($events) $events->listen(RepositoryItemRemoved::class, self::class.'@remove'); } - /** - * @param RepositoryItemInserted $event - */ public function insert(RepositoryItemInserted $event) { if ($event->item instanceof TaxonomyContract) { @@ -101,9 +95,6 @@ private function updateLocalizedTermUris($taxonomy) } } - /** - * @param RepositoryItemRemoved $event - */ public function remove(RepositoryItemRemoved $event) { $this->taxonomyStache->removeData($event->id); diff --git a/src/Translator/Commands/Generate.php b/src/Translator/Commands/Generate.php index 2520ecd91e..340ad072be 100644 --- a/src/Translator/Commands/Generate.php +++ b/src/Translator/Commands/Generate.php @@ -241,7 +241,7 @@ protected function translate() $this->getApplication()->find('translate')->run(new ArrayInput([ 'command' => 'translate', 'lang' => $this->input->getArgument('lang'), - '--key' => $this->input->getOption('key'), + '--key' => $this->input->getOption('key'), ]), $this->output); } } diff --git a/src/View/Antlers/Engine.php b/src/View/Antlers/Engine.php index 2696eea576..d53f9191e6 100644 --- a/src/View/Antlers/Engine.php +++ b/src/View/Antlers/Engine.php @@ -48,9 +48,6 @@ class Engine implements EngineInterface /** * Create a new AntlersEngine instance. - * - * @param Filesystem $filesystem - * @param Parser $parser */ public function __construct(Filesystem $filesystem, Parser $parser) { @@ -74,7 +71,6 @@ public function withoutExtractions() * Get the evaluated contents of the view. * * @param string $path - * @param array $data * @return string */ public function get($path, array $data = []) @@ -150,11 +146,11 @@ public static function renderTag(Parser $parser, $name, $parameters = [], $conte try { $tag = app(TagLoader::class)->load($name, [ - 'parser' => $parser, - 'params' => $parameters, - 'content' => $content, - 'context' => $context, - 'tag' => $name.':'.$original_method, + 'parser' => $parser, + 'params' => $parameters, + 'content' => $content, + 'context' => $context, + 'tag' => $name.':'.$original_method, 'tag_method' => $original_method, ]); diff --git a/src/View/Antlers/Language/Analyzers/NodeTypeAnalyzer.php b/src/View/Antlers/Language/Analyzers/NodeTypeAnalyzer.php index e95ca92e30..992b8a4a16 100644 --- a/src/View/Antlers/Language/Analyzers/NodeTypeAnalyzer.php +++ b/src/View/Antlers/Language/Analyzers/NodeTypeAnalyzer.php @@ -18,6 +18,7 @@ public static function analyze($nodes, EnvironmentDetails $environmentDetails) if ($node instanceof AntlersNode) { if ($node->pathReference != null && $node->pathReference->isStrictVariableReference) { $node->isTagNode = false; + continue; } diff --git a/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php b/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php index 7a18c6a098..30026f0233 100644 --- a/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php +++ b/src/View/Antlers/Language/Analyzers/TagPairAnalyzer.php @@ -188,7 +188,6 @@ private function canPossiblyClose($node) /** * @param AbstractNode[] $nodes * @param AntlersNode $node - * @param $scanFor */ private function findClosingPair($nodes, $node, $scanFor) { @@ -226,12 +225,14 @@ private function findClosingPair($nodes, $node, $scanFor) $refStack += 1; } + continue; } if (array_key_exists($candidateNode->name->compound, $scanForFlip)) { if ($refStack > 0) { $refStack -= 1; + continue; } } @@ -247,8 +248,6 @@ private function findClosingPair($nodes, $node, $scanFor) } /** - * @param $documentNodes - * @param $document * @return array * * @throws SyntaxErrorException @@ -354,7 +353,7 @@ public function associate($documentNodes, $document) $nestedNodeKeyMap = []; foreach ($nodes as $node) { - if ($node instanceof AntlersNode && $node->isClosedBy != null) { + if ($node instanceof AntlersNode && $node->isClosedBy != null) { $content = $this->document->getText( $node->endPosition->index + 1, $node->isClosedBy->startPosition->index); diff --git a/src/View/Antlers/Language/Errors/LineRetriever.php b/src/View/Antlers/Language/Errors/LineRetriever.php index 7664ff1eed..68a687abf6 100644 --- a/src/View/Antlers/Language/Errors/LineRetriever.php +++ b/src/View/Antlers/Language/Errors/LineRetriever.php @@ -127,7 +127,7 @@ public static function getNearText(AbstractNode $node) $node instanceof NullConstant || $node instanceof TrueConstant || $node instanceof FalseConstant || $node instanceof LogicalNegationOperator || $node instanceof LanguageOperatorConstruct || $node instanceof ArgSeparator || $node instanceof StatementSeparatorNode || $node instanceof AdditionAssignmentOperator || - $node instanceof AdditionOperator || $node instanceof SubtractionAssignmentOperator || $node instanceof SubtractionOperator || + $node instanceof AdditionOperator || $node instanceof SubtractionAssignmentOperator || $node instanceof SubtractionOperator || $node instanceof ExponentiationOperator || $node instanceof MultiplicationAssignmentOperator || $node instanceof MultiplicationOperator || $node instanceof DivisionAssignmentOperator || $node instanceof DivisionOperator || $node instanceof ModulusAssignmentOperator || $node instanceof ModulusOperator || $node instanceof SpaceshipCompOperator || $node instanceof LessThanEqualCompOperator || diff --git a/src/View/Antlers/Language/Lexer/AntlersLexer.php b/src/View/Antlers/Language/Lexer/AntlersLexer.php index f4ea4f1ac9..e45b2b8423 100644 --- a/src/View/Antlers/Language/Lexer/AntlersLexer.php +++ b/src/View/Antlers/Language/Lexer/AntlersLexer.php @@ -253,6 +253,7 @@ public function tokenize(AntlersNode $node, $input) $this->currentContent = []; $this->runtimeNodes[] = $stringConcat; $this->currentIndex += 1; + continue; } @@ -268,6 +269,7 @@ public function tokenize(AntlersNode $node, $input) $terminator = $this->cur; $this->isParsingString = true; $stringStartedOn = $this->currentIndex; + continue; } } @@ -302,6 +304,7 @@ public function tokenize(AntlersNode $node, $input) if ($nextNonWhitespace === DocumentParser::String_Terminator_SingleQuote || $nextNonWhitespace === DocumentParser::String_Terminator_DoubleQuote) { $this->currentContent = []; + continue; } } @@ -324,6 +327,7 @@ public function tokenize(AntlersNode $node, $input) $this->currentContent = []; $this->isInModifierParameterValue = false; + continue; } @@ -371,6 +375,7 @@ public function tokenize(AntlersNode $node, $input) } else { $this->currentContent[] = $this->cur; } + continue; } @@ -396,6 +401,7 @@ public function tokenize(AntlersNode $node, $input) $this->currentContent = []; $this->isParsingString = false; $this->isInModifierParameterValue = false; + continue; } @@ -414,6 +420,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $stringNode; $this->lastNode = $stringNode; } + continue; } @@ -422,26 +429,32 @@ public function tokenize(AntlersNode $node, $input) $this->currentContent[] = DocumentParser::String_EscapeCharacter; $this->ignorePrevious = true; $this->currentIndex += 1; + continue; } elseif ($this->next == DocumentParser::String_Terminator_SingleQuote) { $this->currentContent[] = DocumentParser::String_Terminator_SingleQuote; $this->currentIndex += 1; + continue; } elseif ($this->next == DocumentParser::String_Terminator_DoubleQuote) { $this->currentContent[] = DocumentParser::String_Terminator_DoubleQuote; $this->currentIndex += 1; + continue; } elseif ($this->next == 'n') { $this->currentContent[] = "\n"; $this->currentIndex += 1; + continue; } elseif ($this->next == 't') { $this->currentContent[] = "\t"; $this->currentIndex += 1; + continue; } elseif ($this->next == 'r') { $this->currentContent[] = "\r"; $this->currentIndex += 1; + continue; } } @@ -476,6 +489,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalAnd; $this->lastNode = $logicalAnd; + continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalOr) { $logicalOr = new LogicalOrOperator(); @@ -485,6 +499,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalOr; $this->lastNode = $logicalOr; + continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalXor) { $logicalXor = new LogicalXorOperator(); @@ -494,6 +509,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalXor; $this->lastNode = $logicalXor; + continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstNull) { $constNull = new NullConstant(); @@ -503,6 +519,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $constNull; $this->lastNode = $constNull; + continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstTrue) { $constTrue = new TrueConstant(); @@ -512,6 +529,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $constTrue; $this->lastNode = $constTrue; + continue; } elseif ($lowerParsedValue == LanguageKeywords::ConstFalse) { $constFalse = new FalseConstant(); @@ -521,6 +539,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $constFalse; $this->lastNode = $constFalse; + continue; } elseif ($lowerParsedValue == LanguageKeywords::LogicalNot) { $logicNegation = new LogicalNegationOperator(); @@ -530,6 +549,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicNegation; $this->lastNode = $logicNegation; + continue; } elseif ($parsedValue == LanguageKeywords::ArrList && $this->next == DocumentParser::LeftParen) { $tupleListStart = new TupleListStart(); @@ -539,6 +559,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $tupleListStart; $this->lastNode = $tupleListStart; + continue; } @@ -556,6 +577,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $numberNode; $this->lastNode = $numberNode; + continue; } @@ -569,6 +591,7 @@ public function tokenize(AntlersNode $node, $input) $modifierNameNode->endPosition = $endPosition; $this->runtimeNodes[] = $modifierNameNode; $this->lastNode = $modifierNameNode; + continue; } elseif ($lastValue instanceof ModifierValueSeparator) { $modifierValueNode = new ModifierValueNode(); @@ -580,6 +603,7 @@ public function tokenize(AntlersNode $node, $input) $this->lastNode = $modifierValueNode; $this->isParsingModifierName = false; + continue; } } @@ -605,6 +629,7 @@ public function tokenize(AntlersNode $node, $input) } } else { $this->currentContent[] = $this->cur; + continue; } @@ -636,6 +661,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $argSeparator; $this->lastNode = $argSeparator; + continue; } @@ -648,6 +674,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $statementSeparator; $this->lastNode = $statementSeparator; + continue; } @@ -662,6 +689,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $additionAssignment; $this->lastNode = $additionAssignment; $this->currentIndex += 1; + continue; } @@ -672,6 +700,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $additionOperator; $this->lastNode = $additionOperator; + continue; } @@ -681,6 +710,7 @@ public function tokenize(AntlersNode $node, $input) ctype_digit((string) $this->prev) == false && $this->prev != DocumentParser::RightParent) && $this->isRightOfInterpolationRegion() == false) { $this->currentContent[] = $this->cur; + continue; } @@ -693,6 +723,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $subtractionAssignment; $this->lastNode = $subtractionAssignment; $this->currentIndex += 1; + continue; } elseif ($this->next == DocumentParser::Punctuation_GreaterThan) { $methodInvocation = new MethodInvocationNode(); @@ -703,6 +734,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $methodInvocation; $this->lastNode = $methodInvocation; $this->currentIndex += 1; + continue; } @@ -713,6 +745,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $subtractionOperator; $this->lastNode = $subtractionOperator; + continue; } @@ -727,6 +760,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $exponentiationOperator; $this->lastNode = $exponentiationOperator; $this->currentIndex += 1; + continue; } elseif ($this->next == DocumentParser::Punctuation_Equals) { $multiplicationAssignment = new MultiplicationAssignmentOperator(); @@ -737,6 +771,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $multiplicationAssignment; $this->lastNode = $multiplicationAssignment; $this->currentIndex += 1; + continue; } @@ -748,6 +783,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $multiplicationOperator; $this->lastNode = $multiplicationOperator; + continue; } @@ -762,6 +798,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $divisionAssignment; $this->lastNode = $divisionAssignment; $this->currentIndex += 1; + continue; } @@ -772,6 +809,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $divisionOperator; $this->lastNode = $divisionOperator; + continue; } @@ -786,6 +824,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $modulusAssignment; $this->lastNode = $modulusAssignment; $this->currentIndex += 1; + continue; } @@ -796,6 +835,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $modulusOperator; $this->lastNode = $modulusOperator; + continue; } @@ -817,6 +857,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $spaceshipOperator; $this->lastNode = $spaceshipOperator; $this->currentIndex += 2; + continue; } @@ -829,6 +870,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $lessThanEqual; $this->lastNode = $lessThanEqual; $this->currentIndex += 1; + continue; } @@ -840,6 +882,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $lessThan; $this->lastNode = $lessThan; + continue; } @@ -854,6 +897,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $greaterThanEqual; $this->lastNode = $greaterThanEqual; $this->currentIndex += 1; + continue; } @@ -864,6 +908,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $greaterThan; $this->lastNode = $greaterThan; + continue; } @@ -875,6 +920,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $leftAssignment; $this->lastNode = $leftAssignment; + continue; } @@ -906,6 +952,7 @@ public function tokenize(AntlersNode $node, $input) $this->lastNode = $equalOperator; $this->currentIndex += 1; } + continue; } @@ -920,6 +967,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalAnd; $this->lastNode = $logicalAnd; $this->currentIndex += 1; + continue; } @@ -932,6 +980,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $concatOperator; $this->lastNode = $concatOperator; $this->currentIndex += 1; + continue; } @@ -942,6 +991,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalAnd; $this->lastNode = $logicalAnd; + continue; } @@ -955,6 +1005,7 @@ public function tokenize(AntlersNode $node, $input) $this->lastNode = $modifierSeparator; $this->isParsingModifierName = true; + continue; } @@ -968,6 +1019,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalOr; $this->lastNode = $logicalOr; $this->currentIndex += 1; + continue; } @@ -989,6 +1041,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $strictNotEqual; $this->lastNode = $strictNotEqual; $this->currentIndex += 2; + continue; } @@ -1001,6 +1054,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $notEqual; $this->lastNode = $notEqual; $this->currentIndex += 1; + continue; } @@ -1012,6 +1066,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalNot; $this->lastNode = $logicalNot; + continue; } @@ -1025,6 +1080,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $conditionalFallback; $this->lastNode = $conditionalFallback; $this->currentIndex += 1; + continue; } @@ -1038,6 +1094,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $nullCoalesceOperator; $this->lastNode = $nullCoalesceOperator; $this->currentIndex += 1; + continue; } @@ -1051,6 +1108,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $nullCoalesceOperator; $this->lastNode = $nullCoalesceOperator; $this->currentIndex += 1; + continue; } @@ -1063,6 +1121,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $ternarySeparator; $this->lastNode = $ternarySeparator; + continue; } @@ -1074,6 +1133,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalGroupBegin; $this->lastNode = $logicalGroupBegin; + continue; } @@ -1085,6 +1145,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $logicalGroupEnd; $this->lastNode = $logicalGroupEnd; + continue; } @@ -1107,6 +1168,7 @@ public function tokenize(AntlersNode $node, $input) } else { $this->isInModifierParameterValue = false; } + continue; } } @@ -1119,6 +1181,7 @@ public function tokenize(AntlersNode $node, $input) $this->lastNode->endPosition->char += 2; } $this->currentIndex += 1; + continue; } @@ -1130,6 +1193,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $branchSeparator; $this->lastNode = $branchSeparator; $this->isParsingModifierName = false; + continue; } @@ -1141,6 +1205,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $implicitArrayBegin; $this->lastNode = $implicitArrayBegin; + continue; } @@ -1152,6 +1217,7 @@ public function tokenize(AntlersNode $node, $input) $this->runtimeNodes[] = $implicitArrayEnd; $this->lastNode = $implicitArrayEnd; + continue; } } diff --git a/src/View/Antlers/Language/Nodes/AntlersNode.php b/src/View/Antlers/Language/Nodes/AntlersNode.php index 281173422b..691a30e320 100644 --- a/src/View/Antlers/Language/Nodes/AntlersNode.php +++ b/src/View/Antlers/Language/Nodes/AntlersNode.php @@ -382,10 +382,6 @@ protected function isVoidValue($value) /** * Returns the value of a single parameter by name. * - * @param $parameterName - * @param NodeProcessor $processor - * @param $data - * @param $default * @return array|mixed|\Statamic\Contracts\Query\Builder|string|string[]|null */ public function getSingleParameterValueByName($parameterName, NodeProcessor $processor, $data, $default = null) diff --git a/src/View/Antlers/Language/Parser/AntlersNodeParser.php b/src/View/Antlers/Language/Parser/AntlersNodeParser.php index 04abf015ee..c49d3a974a 100644 --- a/src/View/Antlers/Language/Parser/AntlersNodeParser.php +++ b/src/View/Antlers/Language/Parser/AntlersNodeParser.php @@ -167,11 +167,13 @@ public function parseNode(AntlersNode $node) $terminator = $this->cur; $isParsingString = true; $nameContent[] = $this->cur; + continue; } if ($isParsingString && ctype_space($this->cur)) { $nameContent[] = $this->cur; + continue; } @@ -179,6 +181,7 @@ public function parseNode(AntlersNode $node) $terminator = null; $isParsingString = false; $nameContent[] = $this->cur; + continue; } @@ -434,6 +437,7 @@ private function getParameters(AntlersNode $node) if ($hasFoundName == false && ctype_space($current)) { // Flush the buffer. $currentChars = []; + continue; } @@ -441,6 +445,7 @@ private function getParameters(AntlersNode $node) if (! empty($currentChars)) { if ((ctype_alpha($currentChars[0]) || ctype_digit($currentChars[0]) || $currentChars[0] == DocumentParser::Punctuation_Colon || $currentChars[0] == DocumentParser::AtChar) == false) { $currentChars = []; + continue; } } @@ -461,11 +466,13 @@ private function getParameters(AntlersNode $node) if ($prev == DocumentParser::Punctuation_Equals) { $currentChars = []; + continue; } if (ctype_space($peek) || $peek == DocumentParser::Punctuation_Equals) { $currentChars = []; + continue; } @@ -499,6 +506,7 @@ private function getParameters(AntlersNode $node) if ($peek == DocumentParser::Punctuation_Pipe) { $currentChars = array_merge($currentChars, DocumentParser::getPipeEscapeArray()); $i += 1; + continue; } @@ -506,30 +514,35 @@ private function getParameters(AntlersNode $node) $currentChars[] = DocumentParser::String_EscapeCharacter; $i += 1; $ignorePrevious = true; + continue; } if ($peek == DocumentParser::String_Terminator_DoubleQuote) { $currentChars[] = DocumentParser::String_Terminator_DoubleQuote; $i += 1; + continue; } if ($peek == DocumentParser::String_Terminator_SingleQuote) { $currentChars[] = DocumentParser::String_Terminator_SingleQuote; $i += 1; + continue; } if ($peek == 'n') { $currentChars[] = "\n"; $i += 1; + continue; } if ($peek == 'r') { $currentChars[] = "\r"; $i += 1; + continue; } } @@ -568,6 +581,7 @@ private function getParameters(AntlersNode $node) $parameters[] = $parameterNode; $name = ''; + continue; } diff --git a/src/View/Antlers/Language/Parser/DocumentParser.php b/src/View/Antlers/Language/Parser/DocumentParser.php index dfbb5e4664..09721759e4 100644 --- a/src/View/Antlers/Language/Parser/DocumentParser.php +++ b/src/View/Antlers/Language/Parser/DocumentParser.php @@ -1198,8 +1198,6 @@ private function makeLiteralNode($buffer, $startOffset, $currentOffset) } /** - * @param $offset - * @param $index * @param false $isRelativeOffset * @return Position */ diff --git a/src/View/Antlers/Language/Parser/LanguageParser.php b/src/View/Antlers/Language/Parser/LanguageParser.php index be906946d8..63676535b1 100644 --- a/src/View/Antlers/Language/Parser/LanguageParser.php +++ b/src/View/Antlers/Language/Parser/LanguageParser.php @@ -168,10 +168,12 @@ private function rewriteImplicitArraysToKeywordForm($nodes) $logicGroupBegin = new LogicGroupBegin(); $newNodes[] = $arrConstruct; $newNodes[] = $logicGroupBegin; + continue; } elseif ($thisNode instanceof ImplicitArrayEnd) { $logicGroupEnd = new LogicGroupEnd(); $newNodes[] = $logicGroupEnd; + continue; } else { $newNodes[] = $thisNode; @@ -338,6 +340,7 @@ public function associateMethodCalls($tokens) $this->createdMethods = true; $i += 1; + continue; } elseif ($thisNode instanceof LogicGroup && $prevNode instanceof VariableNode && $prevNode->variableReference != null && count($prevNode->variableReference->pathParts) >= 2) { @@ -417,6 +420,7 @@ public function associateMethodCalls($tokens) $this->createdMethods = true; $i += 1; + continue; } elseif ($thisNode instanceof InlineBranchSeparator && $prevNode instanceof MethodInvocationNode) { if ($i + 1 > $nodeCount) { @@ -468,6 +472,7 @@ public function associateMethodCalls($tokens) $this->createdMethods = true; $i += 2; + continue; } elseif ($thisNode instanceof MethodInvocationNode) { if ($i + 1 > $nodeCount) { @@ -543,12 +548,14 @@ private function createLanguageOperators($tokens) if (array_key_exists($checkParts[0], LanguageOperatorRegistry::$operators)) { $tokens[$i] = $this->convertVarNodeToOperator($thisNode); + continue; } } if (array_key_exists($thisNode->name, LanguageOperatorRegistry::$operators)) { $tokens[$i] = $this->convertVarNodeToOperator($thisNode); + continue; } } @@ -557,6 +564,7 @@ private function createLanguageOperators($tokens) if ($i + 1 >= $nodeCount) { // Convert it into a variable type node. $tokens[$i] = $this->convertOperatorToVarNode($thisNode); + continue; } @@ -565,6 +573,7 @@ private function createLanguageOperators($tokens) if ($next instanceof StatementSeparatorNode) { // Convert it into a variable type node. $tokens[$i] = $this->convertOperatorToVarNode($thisNode); + continue; } } @@ -740,6 +749,7 @@ private function createTupleLists($tokens) $newTokens[] = $arrayNode; $i += 1; + continue; } else { $newTokens[] = $thisToken; @@ -875,6 +885,7 @@ private function createOperatorInvocations($tokens) $newTokens[] = $token; $newTokens[] = $orderGroup; $i += 1; + continue; } elseif ($token->content == LanguageOperatorRegistry::ARR_GROUPBY) { if ($i + 1 >= $tokenCount) { @@ -924,6 +935,7 @@ private function createOperatorInvocations($tokens) $groupFields->parsedName = $peekTwo; $i += 3; + continue; } else { throw ErrorFactory::makeSyntaxError( @@ -936,6 +948,7 @@ private function createOperatorInvocations($tokens) } $i += 1; + continue; } elseif ($token->content == LanguageOperatorRegistry::STRUCT_SWITCH) { if ($i + 1 >= $tokenCount) { @@ -948,6 +961,7 @@ private function createOperatorInvocations($tokens) } $newTokens[] = $token->originalAbstractNode; + continue; } @@ -987,7 +1001,7 @@ private function createOperatorInvocations($tokens) if (! empty($wrapperSemanticGroup->nodes)) { $firstNode = $wrapperSemanticGroup->nodes[0]; - if ($firstNode instanceof ArrayNode && $firstNode->hasModifiers()) { + if ($firstNode instanceof ArrayNode && $firstNode->hasModifiers()) { $shouldError = false; } elseif ($firstNode instanceof VariableNode) { $shouldError = false; @@ -1098,6 +1112,7 @@ private function createOperatorInvocations($tokens) } $c += 2; + continue; } } @@ -1108,6 +1123,7 @@ private function createOperatorInvocations($tokens) $newTokens[] = $switchGroup; $i += 1; + continue; } elseif ($token->content == LanguageOperatorRegistry::ARR_MAKE) { if ($i + 1 >= $tokenCount) { @@ -1134,7 +1150,7 @@ private function createOperatorInvocations($tokens) $subNodes = $subNodes[0]->nodes; } - if ($nextToken instanceof ScopedLogicGroup) { + if ($nextToken instanceof ScopedLogicGroup) { array_unshift($subNodes, new ScopeAssignmentOperator()); array_unshift($subNodes, $nextToken->scope); } @@ -1241,6 +1257,7 @@ private function getArrayValues($nodes) $values[] = $namedValueNode; $i += 3; + continue; } @@ -1253,6 +1270,7 @@ private function getArrayValues($nodes) $values[] = $namedValueNode; $i += 1; + continue; } } @@ -1296,6 +1314,7 @@ private function getValues($nodes) if ($next == null || $next instanceof ArgSeparator) { $values[] = $thisNode; $i += 1; + continue; } } @@ -1371,6 +1390,7 @@ private function makeGroupByFields($nodes) $fields[] = $fieldNode; $i += 1; + continue; } } @@ -1432,6 +1452,7 @@ private function makeOrderGroup($nodes) $orders[] = $orderNode; $i += 1; + continue; } } @@ -1471,6 +1492,7 @@ private function makeArgGroup($nodes) if ($next == null || $next instanceof ArgSeparator) { $argGroup->args[] = $nodes[$i]; $i += 1; + continue; } elseif ($next instanceof InlineBranchSeparator) { if ($i + 2 >= $nodeCount) { @@ -1626,6 +1648,7 @@ private function groupNodesByType($nodes, $type) $i += 1; $newNodes[] = $logicGroup; + continue; } else { $newNodes[] = $node; @@ -1721,6 +1744,7 @@ private function resolveValueRight($nodes, $index) $lastNegation = $curNode; $negationCount += 1; $index += 1; + continue; } elseif ($this->isOperand($curNode)) { $value = $curNode; @@ -1751,6 +1775,7 @@ private function correctTypes($nodes) $branchSeparator->startPosition = $node->startPosition; $branchSeparator->endPosition = $node->endPosition; $newNodes[] = $branchSeparator; + continue; } elseif ($node instanceof ModifierValueNode) { $varNode = new VariableNode(); @@ -1759,6 +1784,7 @@ private function correctTypes($nodes) $varNode->endPosition = $node->endPosition; $varNode->modifierChain = $node->modifierChain; $newNodes[] = $varNode; + continue; } @@ -1848,14 +1874,17 @@ private function combineVariablePaths($tokens) // Skip over the adjusted right. $i += 1; + continue; } else { $newNodes[] = $node; + continue; } } elseif ($node instanceof StringValueNode && $newNodeCount > 0) { if (($i + 1) >= $tokenCount) { $newNodes[] = $node; + continue; } @@ -1871,6 +1900,7 @@ private function combineVariablePaths($tokens) $newNodes[] = $left; $i += 1; + continue; } else { $newNodes[] = $node; @@ -1889,6 +1919,7 @@ private function combineVariablePaths($tokens) $newNodes[] = $left; $i += 1; + continue; } elseif ($this->canMergeIntoVariablePath($right) && $left instanceof VariableNode) { array_pop($newNodes); @@ -1901,9 +1932,11 @@ private function combineVariablePaths($tokens) $newNodes[] = $left; $i += 1; + continue; } else { $newNodes[] = $node; + continue; } } elseif ($node instanceof ImplicitArrayEnd && $newNodeCount > 0) { @@ -1928,6 +1961,7 @@ private function combineVariablePaths($tokens) } else { $newNodes[] = $node; } + continue; } elseif ($node instanceof SubtractionOperator && $newNodeCount > 0) { $left = $newNodes[$newNodeCount - 1]; @@ -1997,6 +2031,7 @@ private function createLogicGroupsAroundMethodCalls($nodes) if (! $doContinue) { $newNodes[] = $thisNode; + continue; } @@ -2014,7 +2049,7 @@ private function createLogicGroupsAroundMethodCalls($nodes) $targetNodes[] = $thisNode; // Scan forwards to collect all chained calls. - if ($i + 1 < $nodeLen && $nodes[$i + 1] instanceof MethodInvocationNode) { + if ($i + 1 < $nodeLen && $nodes[$i + 1] instanceof MethodInvocationNode) { $skipTo = $i; for ($j = $i + 1; $j < $nodeLen; $j++) { @@ -2141,6 +2176,7 @@ private function associateModifiers($tokens) $i += $resultCount; $applyModifiersToNode->modifierChain->modifierChain[] = $modifier; + continue; } else { $newNodes[] = $node; @@ -2329,6 +2365,7 @@ private function createModifier($tokens) } $i += 1; + continue; } else { throw ErrorFactory::makeSyntaxError( @@ -2430,12 +2467,14 @@ private function insertAutomaticStatementSeparators($tokens) $adjustedTokens[] = $tokens[$i + 1]; $adjustedTokens[] = new StatementSeparatorNode(); $i += 1; + continue; } else { $adjustedTokens[] = $thisToken; $adjustedTokens[] = $tokens[$i + 1]; $adjustedTokens[] = $tokens[$i + 2]; $i += 2; + continue; } } else { @@ -2509,6 +2548,7 @@ private function createNullCoalescenceGroups($tokens) $newTokens[] = $nullCoalescenceGroup; $i += 1; + continue; } else { $newTokens[] = $node; @@ -2632,6 +2672,7 @@ private function createTernaryGroups($tokens) }*/ $i = $targetJumpIndex; + continue; } else { $newTokens[] = $node; @@ -2707,6 +2748,7 @@ private function createLogicalGroups($tokens) // An even number of negation operators are the same has having no negation operators. if ($negationCount % 2 == 0) { $i += $negationCount - 1; + continue; } @@ -2846,6 +2888,7 @@ private function findLogicalGroupEnd($root, $nodes) $subNodes[] = $subGroup[0]; $skipCount += $subGroup[1]; $i += $subGroup[1]; + continue; } else { $subNodes[] = $node; diff --git a/src/View/Antlers/Language/Parser/PathParser.php b/src/View/Antlers/Language/Parser/PathParser.php index 5dea19b879..b797049bc8 100644 --- a/src/View/Antlers/Language/Parser/PathParser.php +++ b/src/View/Antlers/Language/Parser/PathParser.php @@ -150,6 +150,7 @@ public function parse($content) if ($this->isParsingString && $this->cur == DocumentParser::String_EscapeCharacter && $this->next == $terminator) { $currentChars[] = $terminator; $this->currentIndex += 1; + continue; } @@ -166,6 +167,7 @@ public function parse($content) } } else { $currentChars[] = $this->cur; + continue; } } else { @@ -181,24 +183,29 @@ public function parse($content) if ($this->isParsingString) { if (ctype_space($this->cur)) { $currentChars[] = $this->cur; + continue; } elseif ($this->cur == DocumentParser::String_EscapeCharacter) { if ($this->next == DocumentParser::String_EscapeCharacter) { $currentChars[] = DocumentParser::String_EscapeCharacter; $this->currentIndex += 1; $ignorePrevious = true; + continue; } elseif ($this->next == 'n') { $currentChars[] = "\n"; $this->currentIndex += 1; + continue; } elseif ($this->next == 't') { $currentChars[] = "\t"; $this->currentIndex += 1; + continue; } elseif ($this->next == 'r') { $currentChars[] = "\r"; $this->currentIndex += 1; + continue; } } @@ -247,6 +254,7 @@ public function parse($content) $activeDelimiter = self::ColonSeparator; $this->currentIndex += 1; $isParsingAccessor = false; + continue; } @@ -259,6 +267,7 @@ public function parse($content) if ($lastPart->delimiter == self::ColonSeparator) { $lastPart->delimiter .= $this->cur; + continue; } } @@ -308,9 +317,11 @@ public function parse($content) $parts[] = $pathNode; $currentChars = []; + continue; } else { $currentChars[] = $this->cur; + continue; } } @@ -369,6 +380,7 @@ private function locateEndOfAccessor() $isParsingString = true; $terminator = $cur; $nestedChars[] = $cur; + continue; } @@ -383,6 +395,7 @@ private function locateEndOfAccessor() $nestedChars[] = $cur; $isParsingString = false; $terminator = null; + continue; } @@ -395,6 +408,7 @@ private function locateEndOfAccessor() break; } else { $nestedChars[] = $cur; + continue; } } else { diff --git a/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php b/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php index 95e78e93b3..9b4c6a960c 100644 --- a/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php +++ b/src/View/Antlers/Language/Runtime/Debugging/ScopeDumper.php @@ -49,11 +49,13 @@ public function dump($data) foreach ($data as $k => $v) { if (array_key_exists($k, self::$contextualKeys)) { $contextual[$k] = $v; + continue; } if (is_string($v) || is_numeric($v) || is_bool($v) || is_null($v)) { $root[$k] = $v; + continue; } @@ -68,6 +70,7 @@ public function dump($data) // Move dates to root. if ($v instanceof Carbon) { $root[$k] = $this->dumpCarbon($v); + continue; } @@ -135,6 +138,7 @@ private function createVariables($data) if (is_string($v)) { $variable->value = $v; $vars[] = $variable; + continue; } elseif (is_bool($v)) { if ($v) { @@ -144,18 +148,22 @@ private function createVariables($data) } $vars[] = $variable; + continue; } elseif (is_null($v)) { $variable->value = 'null'; $vars[] = $variable; + continue; } elseif (is_numeric($v)) { $variable->value = strval($v); $vars[] = $variable; + continue; } elseif ($v instanceof HtmlString) { $variable->value = $v->toHtml(); $vars[] = $variable; + continue; } elseif (is_array($v)) { self::$varIndexCount += 1; @@ -165,10 +173,12 @@ private function createVariables($data) $variable->value = '{array['.count($v).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Carbon) { $variable->value = $this->dumpCarbon($v); $vars[] = $variable; + continue; } elseif ($v instanceof Site) { self::$varIndexCount += 1; @@ -178,6 +188,7 @@ private function createVariables($data) $variable->value = '{site}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof \Illuminate\Support\Collection) { self::$varIndexCount += 1; @@ -187,6 +198,7 @@ private function createVariables($data) $variable->value = '{Collection['.$v->count().']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof ViewErrorBag) { self::$varIndexCount += 1; @@ -196,6 +208,7 @@ private function createVariables($data) $variable->value = '{ViewErrorBag['.$v->count().']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Value) { $resolvedValue = null; @@ -210,6 +223,7 @@ private function createVariables($data) if ($resolvedValue instanceof Carbon) { $variable->value = $this->dumpCarbon($resolvedValue); $vars[] = $variable; + continue; } @@ -220,6 +234,7 @@ private function createVariables($data) $variable->value = '{array['.count($resolvedValue).']}'; $variable->variablesReference = $thisVar; + continue; } else { $resolvedValue = $v->value(); @@ -237,6 +252,7 @@ private function createVariables($data) } $vars[] = $variable; + continue; } elseif ($v instanceof Collection) { self::$varIndexCount += 1; @@ -247,6 +263,7 @@ private function createVariables($data) $variable->value = '{Entries\Collection['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Page) { self::$varIndexCount += 1; @@ -257,6 +274,7 @@ private function createVariables($data) $variable->value = '{Page['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof EntryQueryBuilder) { $subVar = $v->get()->all(); @@ -269,6 +287,7 @@ private function createVariables($data) $variable->value = '{EntryQuery['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Entry) { self::$varIndexCount += 1; @@ -279,6 +298,7 @@ private function createVariables($data) $variable->value = '{Entry['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Blueprint) { self::$varIndexCount += 1; @@ -289,6 +309,7 @@ private function createVariables($data) $variable->value = '{Blueprint['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof User) { self::$varIndexCount += 1; @@ -299,6 +320,7 @@ private function createVariables($data) $variable->value = '{User['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof \Statamic\Auth\Eloquent\User) { self::$varIndexCount += 1; @@ -309,6 +331,7 @@ private function createVariables($data) $variable->value = '{EloquentUser['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } elseif ($v instanceof Taxonomy) { self::$varIndexCount += 1; @@ -319,6 +342,7 @@ private function createVariables($data) $variable->value = '{Taxonomy['.count($subVar).']}'; $variable->variablesReference = $thisVar; $vars[] = $variable; + continue; } } diff --git a/src/View/Antlers/Language/Runtime/ModifierManager.php b/src/View/Antlers/Language/Runtime/ModifierManager.php index 61fdf97bac..92d4f56924 100644 --- a/src/View/Antlers/Language/Runtime/ModifierManager.php +++ b/src/View/Antlers/Language/Runtime/ModifierManager.php @@ -43,7 +43,7 @@ public static function guardRuntimeModifier($modifierName) Log::warning('Runtime Access Violation: '.$modifierName, [ 'modifier' => $modifierName, 'file' => GlobalRuntimeState::$currentExecutionFile, - 'trace' => GlobalRuntimeState::$templateFileStack, + 'trace' => GlobalRuntimeState::$templateFileStack, ]); if (GlobalRuntimeState::$throwErrorOnAccessViolation) { @@ -54,7 +54,7 @@ public static function guardRuntimeModifier($modifierName) ); } - return false; + return false; } return true; diff --git a/src/View/Antlers/Language/Runtime/NodeProcessor.php b/src/View/Antlers/Language/Runtime/NodeProcessor.php index f85cd95691..48718c86cf 100644 --- a/src/View/Antlers/Language/Runtime/NodeProcessor.php +++ b/src/View/Antlers/Language/Runtime/NodeProcessor.php @@ -1074,7 +1074,7 @@ public function guardRuntimeTag($tagCheck) Log::warning('Runtime Access Violation: '.$tagCheck, [ 'tag' => $tagCheck, 'file' => GlobalRuntimeState::$currentExecutionFile, - 'trace' => GlobalRuntimeState::$templateFileStack, + 'trace' => GlobalRuntimeState::$templateFileStack, ]); if (GlobalRuntimeState::$throwErrorOnAccessViolation) { @@ -2062,7 +2062,7 @@ public function reduce($processNodes) } } - if ($val instanceof Value) { + if ($val instanceof Value) { if ($val->shouldParseAntlers()) { GlobalRuntimeState::$isEvaluatingUserData = true; GlobalRuntimeState::$isEvaluatingData = true; @@ -2444,7 +2444,7 @@ protected function addLoopIterationVariables($loop) // dealing with a super basic list like [one, two, three] then convert it // to one, where the value is stored in a key named "value". if (! is_array($value)) { - $value = ['value' => $value, 'name' => $value]; + $value = ['value' => $value, 'name' => $value]; } $value['count'] = $index + 1; diff --git a/src/View/Antlers/Language/Runtime/PathDataManager.php b/src/View/Antlers/Language/Runtime/PathDataManager.php index e024c9b16a..32dd2ff48e 100644 --- a/src/View/Antlers/Language/Runtime/PathDataManager.php +++ b/src/View/Antlers/Language/Runtime/PathDataManager.php @@ -405,7 +405,7 @@ private function guardRuntimeAccess($normalizedReference) Log::warning('Runtime Access Violation: '.$normalizedReference, [ 'variable' => $normalizedReference, 'file' => GlobalRuntimeState::$currentExecutionFile, - 'trace' => GlobalRuntimeState::$templateFileStack, + 'trace' => GlobalRuntimeState::$templateFileStack, ]); if (GlobalRuntimeState::$throwErrorOnAccessViolation) { @@ -541,6 +541,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false if ($pathItem instanceof PathNode) { if ($pathItem->isStringVar) { $this->reducedVar = $pathItem->name; + continue; } @@ -564,6 +565,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false } $this->compact($pathItem->isFinal); + continue; } } @@ -640,6 +642,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false } $this->didFind = true; + continue; } } @@ -695,6 +698,7 @@ public function getData(VariableReference $path, $data, $isForArrayIndex = false } $this->doBreak = false; + continue; } else { $referencePath = null; @@ -925,21 +929,25 @@ public static function reduce($value, $isPair = true, $reduceBuildersAndAugmenta } $reductionStack[] = $augmented; + continue; } elseif ($reductionValue instanceof Values) { GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = $reductionValue->toArray(); GlobalRuntimeState::$isEvaluatingData = false; + continue; } elseif ($reductionValue instanceof \Statamic\Entries\Collection) { GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = RuntimeValues::resolveWithRuntimeIsolation($reductionValue); GlobalRuntimeState::$isEvaluatingData = false; + continue; } elseif ($reductionValue instanceof ArrayableString) { GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = $reductionValue->toArray(); GlobalRuntimeState::$isEvaluatingData = false; + continue; } elseif ($reductionValue instanceof Augmentable) { // Avoids resolving augmented data "too early". @@ -960,16 +968,19 @@ public static function reduce($value, $isPair = true, $reduceBuildersAndAugmenta GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = $reductionValue->all(); GlobalRuntimeState::$isEvaluatingData = false; + continue; } elseif ($reductionValue instanceof Arrayable) { GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = $reductionValue->toArray(); GlobalRuntimeState::$isEvaluatingData = false; + continue; } elseif ($reductionValue instanceof Builder && $reduceBuildersAndAugmentables) { GlobalRuntimeState::$isEvaluatingData = true; $reductionStack[] = $reductionValue->get(); GlobalRuntimeState::$isEvaluatingData = false; + continue; } diff --git a/src/View/Antlers/Language/Runtime/RuntimeParser.php b/src/View/Antlers/Language/Runtime/RuntimeParser.php index 7c7e46d799..c45c746cab 100644 --- a/src/View/Antlers/Language/Runtime/RuntimeParser.php +++ b/src/View/Antlers/Language/Runtime/RuntimeParser.php @@ -836,7 +836,6 @@ private function shouldUseFullParserForVariable($text) * array or object. * * @param string $key Dot-notated key to find - * @param $context * @param mixed $default Default value to use if not found * @return mixed * @@ -888,7 +887,6 @@ public function getVariable($key, $context, $default = null) /** * Sets a render callback. * - * @param $callback * @return Parser */ public function callback($callback) diff --git a/src/View/Antlers/Language/Runtime/Sandbox/Environment.php b/src/View/Antlers/Language/Runtime/Sandbox/Environment.php index 2f8dd008cd..1d61d311db 100644 --- a/src/View/Antlers/Language/Runtime/Sandbox/Environment.php +++ b/src/View/Antlers/Language/Runtime/Sandbox/Environment.php @@ -518,6 +518,7 @@ public function process($nodes) } $i += 1; + continue; } elseif ($currentNode instanceof StringConcatenationOperator) { $left = array_pop($stack); @@ -541,6 +542,7 @@ public function process($nodes) } $i += 1; + continue; } elseif ($currentNode instanceof FactorialOperator) { $left = array_pop($stack); @@ -568,6 +570,7 @@ public function process($nodes) $stack[] = ($leftValue / $rightValue); $i += 1; + continue; } elseif ($currentNode instanceof ExponentiationOperator) { $left = array_pop($stack); @@ -581,6 +584,7 @@ public function process($nodes) $stack[] = pow($leftValue, $rightValue); $i += 1; + continue; } elseif ($currentNode instanceof ModulusOperator) { $left = array_pop($stack); @@ -595,6 +599,7 @@ public function process($nodes) $stack[] = ($leftValue % $rightValue); $i += 1; + continue; } elseif ($currentNode instanceof MultiplicationOperator) { $left = array_pop($stack); @@ -608,6 +613,7 @@ public function process($nodes) $stack[] = ($leftValue * $rightValue); $i += 1; + continue; } elseif ($currentNode instanceof SubtractionOperator) { $left = array_pop($stack); @@ -621,6 +627,7 @@ public function process($nodes) $stack[] = ($leftValue - $rightValue); $i += 1; + continue; } elseif ($currentNode instanceof EqualCompOperator) { $left = array_pop($stack); @@ -648,6 +655,7 @@ public function process($nodes) $stack[] = $left == $right; $i += 1; + continue; } elseif ($currentNode instanceof GreaterThanCompOperator) { $left = array_pop($stack); @@ -662,6 +670,7 @@ public function process($nodes) $stack[] = $left > $right; $i += 1; + continue; } elseif ($currentNode instanceof GreaterThanEqualCompOperator) { $left = array_pop($stack); @@ -676,6 +685,7 @@ public function process($nodes) $stack[] = $left >= $right; $i += 1; + continue; } elseif ($currentNode instanceof LessThanCompOperator) { $left = array_pop($stack); @@ -690,6 +700,7 @@ public function process($nodes) $stack[] = $left < $right; $i += 1; + continue; } elseif ($currentNode instanceof LessThanEqualCompOperator) { $left = array_pop($stack); @@ -704,6 +715,7 @@ public function process($nodes) $stack[] = $left <= $right; $i += 1; + continue; } elseif ($currentNode instanceof NotEqualCompOperator) { $left = array_pop($stack); @@ -718,6 +730,7 @@ public function process($nodes) $stack[] = $left != $right; $i += 1; + continue; } elseif ($currentNode instanceof NotStrictEqualCompOperator) { $left = array_pop($stack); @@ -732,6 +745,7 @@ public function process($nodes) $stack[] = $left !== $right; $i += 1; + continue; } elseif ($currentNode instanceof SpaceshipCompOperator) { $left = array_pop($stack); @@ -746,6 +760,7 @@ public function process($nodes) $stack[] = $left <=> $right; $i += 1; + continue; } elseif ($currentNode instanceof StrictEqualCompOperator) { $left = array_pop($stack); @@ -760,6 +775,7 @@ public function process($nodes) $stack[] = $left === $right; $i += 1; + continue; } elseif ($currentNode instanceof LogicalOrOperator) { $left = $this->getValue(array_pop($stack)); @@ -779,6 +795,7 @@ public function process($nodes) } $i += 1; + continue; } elseif ($currentNode instanceof LogicalAndOperator) { $left = $this->getValue(array_pop($stack)); @@ -786,6 +803,7 @@ public function process($nodes) $stack[] = ($this->getComparisonValue($left) && $this->getComparisonValue($right)); $i += 1; + continue; } elseif ($currentNode instanceof LogicalXorOperator) { $left = $this->getValue(array_pop($stack)); @@ -794,12 +812,15 @@ public function process($nodes) $stack[] = ($this->getComparisonValue($left) xor $this->getComparisonValue($right)); $i += 1; + continue; } elseif ($currentNode instanceof LogicGroup) { $stack[] = $currentNode; + continue; } elseif ($currentNode instanceof NullCoalescenceGroup) { $stack[] = $this->adjustValue($this->evaluateNullCoalescence($currentNode), $currentNode); + continue; } elseif ($currentNode instanceof TernaryCondition) { $stack[] = $this->adjustValue($this->evaluateTernaryGroup($currentNode), $currentNode); @@ -812,6 +833,7 @@ public function process($nodes) // Need to skip over the value node. $i += 1; + continue; } elseif ($currentNode instanceof LanguageOperatorConstruct) { if (! array_key_exists($currentNode->content, LanguageOperatorRegistry::$operators)) { @@ -864,18 +886,21 @@ public function process($nodes) } $i += 3; + continue; } elseif ($currentNode instanceof MethodInvocationNode) { $leftNode = array_pop($stack); if ($leftNode == null) { $stack[] = null; + continue; } $leftVal = $this->getValue($leftNode); if ($leftVal == null) { $stack[] = null; + continue; } @@ -904,6 +929,7 @@ public function process($nodes) $exception->getMessage() ); } + continue; } @@ -1119,7 +1145,6 @@ public function process($nodes) /** * Evaluates the provided null coalescence group. * - * @param NullCoalescenceGroup $group The group. * @return mixed|DirectionGroup|ListValueNode|string * * @throws RuntimeException diff --git a/src/View/Antlers/Parser.php b/src/View/Antlers/Parser.php index cf72a94ced..28161e257f 100644 --- a/src/View/Antlers/Parser.php +++ b/src/View/Antlers/Parser.php @@ -261,6 +261,7 @@ public function parseLoopVariables($text, $data) // conflict with local scope variables in the next step. // Also, treat it like a callback if it's a query builder so it can be sent through the query tag. $text = $this->createExtraction('callback_blocks', $match[0][0], $match[0][0], $text); + continue; } @@ -320,15 +321,15 @@ protected function addLoopIterationVariables($loop) // dealing with a super basic list like [one, two, three] then convert it // to one, where the value is stored in a key named "value". if (! is_array($value)) { - $value = ['value' => $value, 'name' => $value]; + $value = ['value' => $value, 'name' => $value]; } $value = array_merge($value, [ - 'count' => $index + 1, - 'index' => $index, + 'count' => $index + 1, + 'index' => $index, 'total_results' => $total, - 'first' => ($index === 0), - 'last' => ($index === $total - 1), + 'first' => ($index === 0), + 'last' => ($index === $total - 1), ]); $index++; @@ -757,8 +758,9 @@ public function parseTernaries($text, $data) // Slide it on back into the template $text = str_replace($match[0], $output, $text); - // Regular old ternary } else { + // Regular old ternary + // Split the tag up $bits = explode('? ', $match[1]); @@ -1432,10 +1434,6 @@ protected function parseModifiers($key) /** * Manipulate data with the use of Modifiers. * - * @param $modifier - * @param $data - * @param $parameters - * @param $context * @return mixed */ protected function runModifier($modifier, $data, $parameters, $context = []) diff --git a/src/View/Debugbar/AddRequestMessage.php b/src/View/Debugbar/AddRequestMessage.php index 8cabe2a995..8d4ff2211c 100644 --- a/src/View/Debugbar/AddRequestMessage.php +++ b/src/View/Debugbar/AddRequestMessage.php @@ -10,7 +10,6 @@ class AddRequestMessage /** * Handle the event. * - * @param ViewRendered $event * @return void */ public function handle(ViewRendered $event) diff --git a/src/View/Debugbar/AddVariables.php b/src/View/Debugbar/AddVariables.php index 872a063f23..a9c1a8b65b 100644 --- a/src/View/Debugbar/AddVariables.php +++ b/src/View/Debugbar/AddVariables.php @@ -9,7 +9,6 @@ class AddVariables /** * Handle the event. * - * @param ViewRendered $event * @return void */ public function handle(ViewRendered $event) diff --git a/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php b/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php index 0bb269ca88..2584317cef 100644 --- a/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php +++ b/src/View/Debugbar/AntlersProfiler/PerformanceCollector.php @@ -154,7 +154,7 @@ public function collect() return [ 'data' => $tracer->getPerformanceData(), - 'system_samples' =>$this->filterSamples($samples), + 'system_samples' => $this->filterSamples($samples), 'source_samples' => $this->makeSourceViewReport($tracer->getOutputObjects(), $tracer->getPathTriggeringOutput()), 'total_antlers_nodes' => $tracer->getTotalNodeOperations(), 'had_active_debug_sessions' => GlobalDebugManager::isDebugSessionActive(), diff --git a/src/View/Events/ViewRendered.php b/src/View/Events/ViewRendered.php index 17bc13dafb..3d65f0afb5 100644 --- a/src/View/Events/ViewRendered.php +++ b/src/View/Events/ViewRendered.php @@ -12,9 +12,6 @@ class ViewRendered extends Event */ public $view; - /** - * @param View $view - */ public function __construct(View $view) { $this->view = $view; diff --git a/tests/Antlers/Runtime/TemplateTest.php b/tests/Antlers/Runtime/TemplateTest.php index 27cb51b40d..94c03fe0a6 100644 --- a/tests/Antlers/Runtime/TemplateTest.php +++ b/tests/Antlers/Runtime/TemplateTest.php @@ -80,7 +80,8 @@ public function it_doesnt_output_anything_if_object_cannot_be_cast_to_a_string() 'line' => 1, 'file' => '', ]); - $object = new class { + $object = new class + { }; $this->assertEquals('', $this->renderString('{{ object }}', compact('object'))); diff --git a/tests/Antlers/Runtime/VariablePriorityTest.php b/tests/Antlers/Runtime/VariablePriorityTest.php index 00d14c37e3..7451d011a0 100644 --- a/tests/Antlers/Runtime/VariablePriorityTest.php +++ b/tests/Antlers/Runtime/VariablePriorityTest.php @@ -190,7 +190,7 @@ public function test_variables_take_priority_over_tags_stress_test() 'if_exists' => 'partial:if_exists', ], 'redirect' => 'redirect', - 'route' => 'route', + 'route' => 'route', 'search' => 'search', 'section' => 'section', 'session' => [ diff --git a/tests/Auth/AugmentedUserTest.php b/tests/Auth/AugmentedUserTest.php index 9654cb48ec..d0aa532b81 100644 --- a/tests/Auth/AugmentedUserTest.php +++ b/tests/Auth/AugmentedUserTest.php @@ -59,30 +59,30 @@ public function it_gets_values() $augmented = new AugmentedUser($user); $expectations = [ - 'id' => ['type' => 'string', 'value' => 'user-id'], - 'name' => ['type' => 'string', 'value' => 'John Smith'], - 'title' => ['type' => 'string', 'value' => 'john@example.com'], - 'email' => ['type' => 'string', 'value' => 'john@example.com'], - 'initials' => ['type' => 'string', 'value' => 'JS'], - 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/users/user-id/edit'], - 'is_user' => ['type' => 'bool', 'value' => true], + 'id' => ['type' => 'string', 'value' => 'user-id'], + 'name' => ['type' => 'string', 'value' => 'John Smith'], + 'title' => ['type' => 'string', 'value' => 'john@example.com'], + 'email' => ['type' => 'string', 'value' => 'john@example.com'], + 'initials' => ['type' => 'string', 'value' => 'JS'], + 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/users/user-id/edit'], + 'is_user' => ['type' => 'bool', 'value' => true], 'last_login' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], - 'avatar' => ['type' => 'string', 'value' => null], - 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/users/user-id'], + 'avatar' => ['type' => 'string', 'value' => null], + 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/users/user-id'], 'preferred_locale' => ['type' => 'string', 'value' => 'en'], - 'roles' => ['type' => 'array', 'value' => ['role_one']], + 'roles' => ['type' => 'array', 'value' => ['role_one']], 'is_role_one' => ['type' => 'bool', 'value' => true], 'is_role_two' => ['type' => 'bool', 'value' => false], - 'groups' => ['type' => 'array', 'value' => ['group_one']], + 'groups' => ['type' => 'array', 'value' => ['group_one']], 'in_group_one' => ['type' => 'bool', 'value' => true], 'in_group_two' => ['type' => 'bool', 'value' => false], - 'one' => ['type' => 'string', 'value' => 'the "one" value on the user'], - 'two' => ['type' => 'string', 'value' => 'the "two" value on the user and in the blueprint'], - 'three' => ['type' => 'string', 'value' => 'the "three" value supplemented on the user'], - 'four' => ['type' => 'string', 'value' => 'the "four" value supplemented on the user and in the blueprint'], + 'one' => ['type' => 'string', 'value' => 'the "one" value on the user'], + 'two' => ['type' => 'string', 'value' => 'the "two" value on the user and in the blueprint'], + 'three' => ['type' => 'string', 'value' => 'the "three" value supplemented on the user'], + 'four' => ['type' => 'string', 'value' => 'the "four" value supplemented on the user and in the blueprint'], 'unused_in_bp' => ['type' => 'string', 'value' => null], ]; diff --git a/tests/Auth/Protect/ProtectionTest.php b/tests/Auth/Protect/ProtectionTest.php index 198b259a84..b3339e98ae 100644 --- a/tests/Auth/Protect/ProtectionTest.php +++ b/tests/Auth/Protect/ProtectionTest.php @@ -53,7 +53,8 @@ public function if_the_data_isnt_protectable_it_doesnt_get_a_scheme() { $this->assertNull($this->protection->scheme()); - $this->protection->setData(new class { + $this->protection->setData(new class + { // }); diff --git a/tests/Composer/AddonChangelogTest.php b/tests/Composer/AddonChangelogTest.php index 752ff189a7..189f13a109 100644 --- a/tests/Composer/AddonChangelogTest.php +++ b/tests/Composer/AddonChangelogTest.php @@ -40,7 +40,7 @@ public function it_checks_for_licensing_limits() public function release_is_always_licensed_if_theres_no_license_limit() { Client::shouldReceive('request') - ->andReturn($this->fakeMarketplaceReleasesResponse(['2.0.0', '1.0.3', '1.0.2', '1.0.1', '1.0.0'])); + ->andReturn($this->fakeMarketplaceReleasesResponse(['2.0.0', '1.0.3', '1.0.2', '1.0.1', '1.0.0'])); $addon = Mockery::mock(new Addon('test')); $addon->shouldReceive('version')->andReturn('1.0.1'); diff --git a/tests/Console/Commands/AssetsMetaTest.php b/tests/Console/Commands/AssetsMetaTest.php index 01dd46976f..da5b693000 100644 --- a/tests/Console/Commands/AssetsMetaTest.php +++ b/tests/Console/Commands/AssetsMetaTest.php @@ -72,7 +72,7 @@ public function it_generates_one_asset_meta_file_for_asset_with_no_meta_file() Storage::disk('test')->assertMissing('foo/.meta/bar.txt.yaml'); $this->artisan('statamic:assets:meta test_container') - ->expectsOutput('Asset metadata generated'); + ->expectsOutput('Asset metadata generated'); Storage::disk('test')->assertExists('foo/bar.txt'); Storage::disk('test')->assertExists('foo/.meta/bar.txt.yaml'); diff --git a/tests/ConsoleKernel.php b/tests/Console/Kernel.php similarity index 92% rename from tests/ConsoleKernel.php rename to tests/Console/Kernel.php index 17129e2627..ddd12f2d6f 100644 --- a/tests/ConsoleKernel.php +++ b/tests/Console/Kernel.php @@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel /** * Define the application's command schedule. * - * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) diff --git a/tests/Console/PleaseTest.php b/tests/Console/PleaseTest.php index 27a9e98ab7..22445015e7 100644 --- a/tests/Console/PleaseTest.php +++ b/tests/Console/PleaseTest.php @@ -8,6 +8,13 @@ class PleaseTest extends TestCase { + public function setUp(): void + { + require_once __DIR__.'/Kernel.php'; + + parent::setUp(); + } + /** @test */ public function it_can_run_an_artisan_command_with_statamic_prefix() { diff --git a/tests/Data/AugmentedTest.php b/tests/Data/AugmentedTest.php index 35fae7cc87..fc5a709b19 100644 --- a/tests/Data/AugmentedTest.php +++ b/tests/Data/AugmentedTest.php @@ -43,7 +43,8 @@ private function assertNullValue($actual) /** @test */ public function it_gets_a_single_value_by_key() { - $augmented = new class($this->thing) extends BaseAugmentedThing { + $augmented = new class($this->thing) extends BaseAugmentedThing + { // }; @@ -54,7 +55,8 @@ public function it_gets_a_single_value_by_key() /** @test */ public function it_can_use_null_as_a_supplement_value() { - $augmented = new class($this->thing) extends BaseAugmentedThing { + $augmented = new class($this->thing) extends BaseAugmentedThing + { // }; @@ -76,7 +78,8 @@ public function value($key) } }; - $augmented = new class($thingWithValueMethod) extends BaseAugmentedThing { + $augmented = new class($thingWithValueMethod) extends BaseAugmentedThing + { // }; diff --git a/tests/Data/Entries/AugmentedEntryTest.php b/tests/Data/Entries/AugmentedEntryTest.php index 83fead61b7..30878bb37b 100644 --- a/tests/Data/Entries/AugmentedEntryTest.php +++ b/tests/Data/Entries/AugmentedEntryTest.php @@ -86,37 +86,37 @@ public function it_gets_values() $augmented = new AugmentedEntry($entry); $expectations = [ - 'id' => ['type' => 'string', 'value' => 'entry-id'], - 'origin_id' => ['type' => 'string', 'value' => 'origin-id'], - 'slug' => ['type' => 'string', 'value' => 'entry-slug'], - 'uri' => ['type' => 'string', 'value' => '/test/entry-slug'], - 'url' => ['type' => 'string', 'value' => '/test/entry-slug'], - 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/collections/test/entries/entry-id'], - 'permalink' => ['type' => 'string', 'value' => 'http://localhost/test/entry-slug'], - 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/collections/test/entries/entry-id'], - 'status' => ['type' => 'string', 'value' => 'published'], - 'published' => ['type' => 'bool', 'value' => true], - 'private' => ['type' => 'bool', 'value' => false], - 'date' => ['type' => Carbon::class, 'value' => '2018-01-03 17:05:12'], - 'order' => ['type' => 'null', 'value' => null], // todo: test for when this is an int - 'is_entry' => ['type' => 'bool', 'value' => true], - 'collection' => ['type' => CollectionContract::class, 'value' => $collection], - 'blueprint' => ['type' => FieldsBlueprint::class, 'value' => $blueprint], - 'mount' => ['type' => CollectionContract::class, 'value' => $mount], - 'locale' => ['type' => 'string', 'value' => 'en'], + 'id' => ['type' => 'string', 'value' => 'entry-id'], + 'origin_id' => ['type' => 'string', 'value' => 'origin-id'], + 'slug' => ['type' => 'string', 'value' => 'entry-slug'], + 'uri' => ['type' => 'string', 'value' => '/test/entry-slug'], + 'url' => ['type' => 'string', 'value' => '/test/entry-slug'], + 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/collections/test/entries/entry-id'], + 'permalink' => ['type' => 'string', 'value' => 'http://localhost/test/entry-slug'], + 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/collections/test/entries/entry-id'], + 'status' => ['type' => 'string', 'value' => 'published'], + 'published' => ['type' => 'bool', 'value' => true], + 'private' => ['type' => 'bool', 'value' => false], + 'date' => ['type' => Carbon::class, 'value' => '2018-01-03 17:05:12'], + 'order' => ['type' => 'null', 'value' => null], // todo: test for when this is an int + 'is_entry' => ['type' => 'bool', 'value' => true], + 'collection' => ['type' => CollectionContract::class, 'value' => $collection], + 'blueprint' => ['type' => FieldsBlueprint::class, 'value' => $blueprint], + 'mount' => ['type' => CollectionContract::class, 'value' => $mount], + 'locale' => ['type' => 'string', 'value' => 'en'], 'last_modified' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], - 'updated_at' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], - 'updated_by' => ['type' => UserContract::class, 'value' => 'test-user'], - 'one' => ['type' => 'string', 'value' => 'the "one" value on the entry'], - 'two' => ['type' => 'string', 'value' => 'the "two" value on the entry and in the blueprint'], - 'three' => ['type' => 'string', 'value' => 'the "three" value supplemented on the entry'], - 'four' => ['type' => 'string', 'value' => 'the "four" value supplemented on the entry and in the blueprint'], - 'five' => ['type' => 'string', 'value' => 'the "five" value from the origin'], - 'six' => ['type' => 'string', 'value' => 'the "six" value from the origin and in the blueprint'], - 'seven' => ['type' => 'string', 'value' => 'the "seven" value from the collection'], - 'eight' => ['type' => 'null', 'value' => null], // explicitly supplemented null - 'title' => ['type' => 'string', 'value' => null], - 'unused_in_bp' => ['type' => 'string', 'value' => null], + 'updated_at' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], + 'updated_by' => ['type' => UserContract::class, 'value' => 'test-user'], + 'one' => ['type' => 'string', 'value' => 'the "one" value on the entry'], + 'two' => ['type' => 'string', 'value' => 'the "two" value on the entry and in the blueprint'], + 'three' => ['type' => 'string', 'value' => 'the "three" value supplemented on the entry'], + 'four' => ['type' => 'string', 'value' => 'the "four" value supplemented on the entry and in the blueprint'], + 'five' => ['type' => 'string', 'value' => 'the "five" value from the origin'], + 'six' => ['type' => 'string', 'value' => 'the "six" value from the origin and in the blueprint'], + 'seven' => ['type' => 'string', 'value' => 'the "seven" value from the collection'], + 'eight' => ['type' => 'null', 'value' => null], // explicitly supplemented null + 'title' => ['type' => 'string', 'value' => null], + 'unused_in_bp' => ['type' => 'string', 'value' => null], ]; $this->assertAugmentedCorrectly($expectations, $augmented); diff --git a/tests/Data/Entries/EntryTest.php b/tests/Data/Entries/EntryTest.php index bf0d5fb750..8883463bdb 100644 --- a/tests/Data/Entries/EntryTest.php +++ b/tests/Data/Entries/EntryTest.php @@ -23,7 +23,6 @@ use Statamic\Events\EntrySaved; use Statamic\Events\EntrySaving; use Statamic\Facades; -use Statamic\Facades\User; use Statamic\Fields\Blueprint; use Statamic\Fields\Fieldtype; use Statamic\Fields\Value; diff --git a/tests/Data/Taxonomies/AugmentedTermTest.php b/tests/Data/Taxonomies/AugmentedTermTest.php index c34c6ef8c5..a719cb3ee4 100644 --- a/tests/Data/Taxonomies/AugmentedTermTest.php +++ b/tests/Data/Taxonomies/AugmentedTermTest.php @@ -47,25 +47,25 @@ public function it_gets_values() $augmented = new AugmentedTerm($term); $expectations = [ - 'id' => ['type' => 'string', 'value' => 'test::term-slug'], - 'slug' => ['type' => 'string', 'value' => 'term-slug'], - 'title' => ['type' => 'string', 'value' => 'term-slug'], - 'uri' => ['type' => 'string', 'value' => '/test/term-slug'], - 'url' => ['type' => 'string', 'value' => '/test/term-slug'], - 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/taxonomies/test/terms/term-slug/en'], - 'permalink' => ['type' => 'string', 'value' => 'http://localhost/test/term-slug'], - 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/taxonomies/test/terms/term-slug'], - 'is_term' => ['type' => 'bool', 'value' => true], - 'taxonomy' => ['type' => TaxonomyContract::class, 'value' => $taxonomy], + 'id' => ['type' => 'string', 'value' => 'test::term-slug'], + 'slug' => ['type' => 'string', 'value' => 'term-slug'], + 'title' => ['type' => 'string', 'value' => 'term-slug'], + 'uri' => ['type' => 'string', 'value' => '/test/term-slug'], + 'url' => ['type' => 'string', 'value' => '/test/term-slug'], + 'edit_url' => ['type' => 'string', 'value' => 'http://localhost/cp/taxonomies/test/terms/term-slug/en'], + 'permalink' => ['type' => 'string', 'value' => 'http://localhost/test/term-slug'], + 'api_url' => ['type' => 'string', 'value' => 'http://localhost/api/taxonomies/test/terms/term-slug'], + 'is_term' => ['type' => 'bool', 'value' => true], + 'taxonomy' => ['type' => TaxonomyContract::class, 'value' => $taxonomy], 'entries_count' => ['type' => 'int', 'value' => 0], - 'entries' => ['type' => BuilderContract::class], - 'one' => ['type' => 'string', 'value' => 'the "one" value on the term'], - 'two' => ['type' => 'string', 'value' => 'the "two" value on the term and in the blueprint'], - 'three' => ['type' => 'string', 'value' => 'the "three" value from the taxonomy'], - 'unused_in_bp' => ['type' => 'string', 'value' => null], - 'locale' => ['type' => 'string', 'value' => 'en'], - 'updated_at' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], - 'updated_by' => ['type' => UserContract::class, 'value' => 'test-user'], + 'entries' => ['type' => BuilderContract::class], + 'one' => ['type' => 'string', 'value' => 'the "one" value on the term'], + 'two' => ['type' => 'string', 'value' => 'the "two" value on the term and in the blueprint'], + 'three' => ['type' => 'string', 'value' => 'the "three" value from the taxonomy'], + 'unused_in_bp' => ['type' => 'string', 'value' => null], + 'locale' => ['type' => 'string', 'value' => 'en'], + 'updated_at' => ['type' => Carbon::class, 'value' => '2017-02-03 14:10'], + 'updated_by' => ['type' => UserContract::class, 'value' => 'test-user'], ]; $this->assertAugmentedCorrectly($expectations, $augmented); diff --git a/tests/Fakes/Composer/Package/PackToTheFuture.php b/tests/Fakes/Composer/Package/PackToTheFuture.php index 1cae933049..494c21610e 100644 --- a/tests/Fakes/Composer/Package/PackToTheFuture.php +++ b/tests/Fakes/Composer/Package/PackToTheFuture.php @@ -2,7 +2,6 @@ namespace Tests\Fakes\Composer\Package; -use Illuminate\Support\Facades\File; use Statamic\Facades\Path; class PackToTheFuture @@ -12,8 +11,6 @@ class PackToTheFuture /** * Set version on default test package. - * - * @param string $version */ public static function setVersion(string $version) { @@ -22,9 +19,6 @@ public static function setVersion(string $version) /** * Set addon package name and version on our test package. - * - * @param string $package - * @param string $version */ public static function setAddon(string $package, string $version) { @@ -51,9 +45,6 @@ public static function setAddon(string $package, string $version) /** * Generate composer.json file for our test package. * - * @param string $package - * @param string $version - * @param array $extra * @param string|null $version */ public static function generateComposerJson(string $package, string $version, array $extra = [], $path = null) @@ -72,8 +63,6 @@ public static function generateComposerJson(string $package, string $version, ar /** * Generate composer.lock file for our test package. * - * @param string $package - * @param string $version * @param string|null $path */ public static function generateComposerLock(string $package, string $version, $path = null, $dev = false) diff --git a/tests/Feature/Collections/Blueprints/ViewBlueprintListingTest.php b/tests/Feature/Collections/Blueprints/ViewBlueprintListingTest.php index 315f6ba5bd..a1b1a64916 100644 --- a/tests/Feature/Collections/Blueprints/ViewBlueprintListingTest.php +++ b/tests/Feature/Collections/Blueprints/ViewBlueprintListingTest.php @@ -2,7 +2,6 @@ namespace Tests\Feature\Collections\Blueprints; -use Statamic\Auth\User; use Statamic\Facades; use Statamic\Facades\Collection; use Statamic\Fields\Blueprint; diff --git a/tests/Feature/Collections/UpdateCollectionTest.php b/tests/Feature/Collections/UpdateCollectionTest.php index 7ec4fd8ec5..cb8edd9fd5 100644 --- a/tests/Feature/Collections/UpdateCollectionTest.php +++ b/tests/Feature/Collections/UpdateCollectionTest.php @@ -37,12 +37,12 @@ public function it_updates_a_collection() $collection = tap( Collection::make('test') - ->title('Original title') - ->dated(false) - ->template('original-template') - ->layout('original-layout') - ->defaultPublishState(true) - ->sortDirection('asc') + ->title('Original title') + ->dated(false) + ->template('original-template') + ->layout('original-layout') + ->defaultPublishState(true) + ->sortDirection('asc') )->save(); $this->assertCount(1, Collection::all()); $this->assertEquals('Original title', $collection->title()); diff --git a/tests/Feature/GlobalSearch/GlobalSearchTest.php b/tests/Feature/GlobalSearch/GlobalSearchTest.php index b04868612b..403bfef434 100644 --- a/tests/Feature/GlobalSearch/GlobalSearchTest.php +++ b/tests/Feature/GlobalSearch/GlobalSearchTest.php @@ -22,16 +22,16 @@ public function it_performs_a_global_search() { $entry1 = tap( Entry::make() - ->id('1')->locale('en')->slug('test-entry-1') - ->set('title', 'Entry 1') - ->collection(tap(Collection::make('test-collection-1')->title('Test Collection 1'))->save()) + ->id('1')->locale('en')->slug('test-entry-1') + ->set('title', 'Entry 1') + ->collection(tap(Collection::make('test-collection-1')->title('Test Collection 1'))->save()) )->save(); $entry2 = tap( Entry::make() - ->id('2')->locale('en')->slug('test-entry-2') - ->set('title', 'Entry 2') - ->collection(tap(Collection::make('test-collection-2')->title('Test Collection 2'))->save()) + ->id('2')->locale('en')->slug('test-entry-2') + ->set('title', 'Entry 2') + ->collection(tap(Collection::make('test-collection-2')->title('Test Collection 2'))->save()) )->save(); $results = collect([$entry1, $entry2])->map->toSearchResult(); diff --git a/tests/Feature/GraphQL/EntriesTest.php b/tests/Feature/GraphQL/EntriesTest.php index 9456c248b0..16ee0cff20 100644 --- a/tests/Feature/GraphQL/EntriesTest.php +++ b/tests/Feature/GraphQL/EntriesTest.php @@ -790,13 +790,13 @@ public function it_only_shows_published_entries_by_default() GQL; $this - ->withoutExceptionHandling() - ->post('/graphql', ['query' => $query]) - ->assertGqlOk() - ->assertExactJson(['data' => ['entries' => ['data' => [ - ['id' => '2', 'title' => 'Art Directed Blog Post'], - ['id' => '4', 'title' => 'Event Two'], - ]]]]); + ->withoutExceptionHandling() + ->post('/graphql', ['query' => $query]) + ->assertGqlOk() + ->assertExactJson(['data' => ['entries' => ['data' => [ + ['id' => '2', 'title' => 'Art Directed Blog Post'], + ['id' => '4', 'title' => 'Event Two'], + ]]]]); $query = <<<'GQL' { @@ -810,13 +810,13 @@ public function it_only_shows_published_entries_by_default() GQL; $this - ->withoutExceptionHandling() - ->post('/graphql', ['query' => $query]) - ->assertGqlOk() - ->assertExactJson(['data' => ['entries' => ['data' => [ - ['id' => '2', 'title' => 'Art Directed Blog Post'], - ['id' => '4', 'title' => 'Event Two'], - ]]]]); + ->withoutExceptionHandling() + ->post('/graphql', ['query' => $query]) + ->assertGqlOk() + ->assertExactJson(['data' => ['entries' => ['data' => [ + ['id' => '2', 'title' => 'Art Directed Blog Post'], + ['id' => '4', 'title' => 'Event Two'], + ]]]]); $query = <<<'GQL' { @@ -830,11 +830,11 @@ public function it_only_shows_published_entries_by_default() GQL; $this - ->withoutExceptionHandling() - ->post('/graphql', ['query' => $query]) - ->assertGqlOk() - ->assertExactJson(['data' => ['entries' => ['data' => [ - ['id' => '1', 'title' => 'Standard Blog Post'], - ]]]]); + ->withoutExceptionHandling() + ->post('/graphql', ['query' => $query]) + ->assertGqlOk() + ->assertExactJson(['data' => ['entries' => ['data' => [ + ['id' => '1', 'title' => 'Standard Blog Post'], + ]]]]); } } diff --git a/tests/Feature/GraphQL/EntryTest.php b/tests/Feature/GraphQL/EntryTest.php index 95a6b413ff..35270def59 100644 --- a/tests/Feature/GraphQL/EntryTest.php +++ b/tests/Feature/GraphQL/EntryTest.php @@ -697,13 +697,13 @@ public function it_only_shows_published_entries_by_default() GQL; $this - ->withoutExceptionHandling() - ->post('/graphql', ['query' => $query]) - ->assertGqlOk() - ->assertExactJson(['data' => ['entry' => [ - 'id' => '6', - 'title' => 'That was so rad!', - ]]]); + ->withoutExceptionHandling() + ->post('/graphql', ['query' => $query]) + ->assertGqlOk() + ->assertExactJson(['data' => ['entry' => [ + 'id' => '6', + 'title' => 'That was so rad!', + ]]]); $query = <<<'GQL' { diff --git a/tests/Feature/Users/UserRegistrationTest.php b/tests/Feature/Users/UserRegistrationTest.php index e41d7b3d79..b94a3ad4a3 100644 --- a/tests/Feature/Users/UserRegistrationTest.php +++ b/tests/Feature/Users/UserRegistrationTest.php @@ -19,7 +19,7 @@ public function events_dispatched_when_user_registered() Event::fake(); $this - ->post(route('statamic.register'), ['email'=>'foo@bar.com', 'password'=>'password', 'password_confirmation'=>'password']) + ->post(route('statamic.register'), ['email' => 'foo@bar.com', 'password' => 'password', 'password_confirmation' => 'password']) ->assertRedirect(); Event::assertDispatched(UserRegistering::class); @@ -36,7 +36,7 @@ public function user_not_saved_when_user_registration_returns_false() }); $this - ->post(route('statamic.register'), ['email'=>'foo@bar.com', 'password'=>'password', 'password_confirmation'=>'password']) + ->post(route('statamic.register'), ['email' => 'foo@bar.com', 'password' => 'password', 'password_confirmation' => 'password']) ->assertRedirect(); $this->assertNull(User::findByEmail('foo@bar.com')); diff --git a/tests/Fields/BlueprintTest.php b/tests/Fields/BlueprintTest.php index 9699c9ca72..bf2dac88c9 100644 --- a/tests/Fields/BlueprintTest.php +++ b/tests/Fields/BlueprintTest.php @@ -855,7 +855,7 @@ public function it_merges_previously_undefined_keys_into_the_config_when_ensurin $this->assertTrue($blueprint->hasField('existing')); $this->assertEquals(['tabs' => [ 'tab_one' => [ - 'sections'=> [ + 'sections' => [ [ 'fields' => [ ['handle' => 'first', 'field' => ['type' => 'text']], @@ -1038,7 +1038,7 @@ public function it_ensures_a_field_exists_in_a_given_tab_if_it_doesnt_exist_at_a 'title' => 'Test', 'tabs' => [ 'tab_one' => [ - 'sections'=> [ + 'sections' => [ [ 'fields' => [ ['handle' => 'one', 'field' => ['type' => 'text']], diff --git a/tests/Fields/FieldTest.php b/tests/Fields/FieldTest.php index e517b1df79..c2dfa6368c 100644 --- a/tests/Fields/FieldTest.php +++ b/tests/Fields/FieldTest.php @@ -51,7 +51,8 @@ public function it_determines_if_localizable() /** @test */ public function it_gets_the_fieldtype() { - $fieldtype = new class extends Fieldtype { + $fieldtype = new class extends Fieldtype + { }; FieldtypeRepository::shouldReceive('find') @@ -287,24 +288,24 @@ public function converts_to_array_suitable_for_rendering_fields_in_publish_compo }); FieldtypeRepository::shouldReceive('find') - ->with('with_processing') - ->andReturn(new class extends Fieldtype + ->with('with_processing') + ->andReturn(new class extends Fieldtype + { + public function preProcess($data) { - public function preProcess($data) - { - return $data.' preprocessed'; - } - }); + return $data.' preprocessed'; + } + }); FieldtypeRepository::shouldReceive('find') - ->with('without_processing') - ->andReturn(new class extends Fieldtype + ->with('without_processing') + ->andReturn(new class extends Fieldtype + { + public function preProcess($data) { - public function preProcess($data) - { - return $data; - } - }); + return $data; + } + }); $field = new Field('test', [ 'type' => 'example', diff --git a/tests/Fields/FieldtypeTest.php b/tests/Fields/FieldtypeTest.php index 0b6efd2629..230bd1a326 100644 --- a/tests/Fields/FieldtypeTest.php +++ b/tests/Fields/FieldtypeTest.php @@ -330,10 +330,12 @@ public function it_wont_override_previously_appended_config_fields() /** @test */ public function it_will_only_append_config_fields_to_the_intended_fieldtype() { - $fieldtype = new class extends Fieldtype { + $fieldtype = new class extends Fieldtype + { }; - $fieldtypeWithAppendedConfig = new class extends Fieldtype { + $fieldtypeWithAppendedConfig = new class extends Fieldtype + { }; $fieldtypeWithAppendedConfig::appendConfigField('group', ['type' => 'text']); diff --git a/tests/Fieldtypes/EntriesTest.php b/tests/Fieldtypes/EntriesTest.php index 54bda9bad1..2d3890657f 100644 --- a/tests/Fieldtypes/EntriesTest.php +++ b/tests/Fieldtypes/EntriesTest.php @@ -161,7 +161,8 @@ public function it_localizes_the_augmented_items_to_the_current_sites_locale_whe { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -180,7 +181,8 @@ public function it_localizes_the_augmented_item_to_the_current_sites_locale_when { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -300,7 +302,8 @@ public function it_localizes_the_shallow_augmented_items_to_the_current_sites_lo { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -334,7 +337,8 @@ public function it_localizes_the_shallow_augmented_item_to_the_current_sites_loc { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; diff --git a/tests/Fieldtypes/TermsTest.php b/tests/Fieldtypes/TermsTest.php index c6f03151a2..334be127cf 100644 --- a/tests/Fieldtypes/TermsTest.php +++ b/tests/Fieldtypes/TermsTest.php @@ -127,7 +127,8 @@ public function it_localizes_the_augmented_items_to_the_current_sites_locale_whe { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -144,7 +145,8 @@ public function it_localizes_the_augmented_item_to_the_current_sites_locale_when { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -270,7 +272,8 @@ public function it_localizes_the_shallow_augmented_items_to_the_current_sites_lo { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -303,7 +306,8 @@ public function it_localizes_the_shallow_augmented_item_to_the_current_sites_loc { Site::setCurrent('fr'); - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; @@ -351,7 +355,8 @@ public function it_attaches_collection_during_augmentation($expectCollection, $p if ($parentIsEntry) { $parent = EntryFactory::id('parent')->collection('blog')->slug('theparent')->locale('fr')->create(); } else { - $parent = new class { + $parent = new class + { // Class does not implement "Localizable" }; } diff --git a/tests/Fieldtypes/TimeTest.php b/tests/Fieldtypes/TimeTest.php index d57f28328a..aac2abca58 100644 --- a/tests/Fieldtypes/TimeTest.php +++ b/tests/Fieldtypes/TimeTest.php @@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Validator; use Illuminate\Validation\ValidationException; use Statamic\Fields\Field; -use Statamic\Fieldtypes\Date; use Statamic\Fieldtypes\Time; use Tests\TestCase; diff --git a/tests/Git/GitEventTest.php b/tests/Git/GitEventTest.php index deeb2f1031..4b2f48ae9a 100644 --- a/tests/Git/GitEventTest.php +++ b/tests/Git/GitEventTest.php @@ -4,7 +4,6 @@ use Facades\Statamic\Fields\BlueprintRepository; use Illuminate\Http\UploadedFile; -use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Storage; use Mockery; use Statamic\Assets\Asset; diff --git a/tests/Modifiers/ParseUrlTest.php b/tests/Modifiers/ParseUrlTest.php index ea0d998b8a..034e926136 100644 --- a/tests/Modifiers/ParseUrlTest.php +++ b/tests/Modifiers/ParseUrlTest.php @@ -13,13 +13,13 @@ public function it_extracts_parseurl() $path = 'http://admin:password@example.com:8080/path?query=1#hash'; $this->assertEquals([ - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '8080', - 'user' => 'admin', - 'pass' => 'password', - 'path' => '/path', - 'query' => 'query=1', + 'scheme' => 'http', + 'host' => 'example.com', + 'port' => '8080', + 'user' => 'admin', + 'pass' => 'password', + 'path' => '/path', + 'query' => 'query=1', 'fragment' => 'hash', ], $this->modify($path)); } diff --git a/tests/Modifiers/PathinfoTest.php b/tests/Modifiers/PathinfoTest.php index ed01b241e2..1884e2ac61 100644 --- a/tests/Modifiers/PathinfoTest.php +++ b/tests/Modifiers/PathinfoTest.php @@ -13,9 +13,9 @@ public function it_extracts_pathinfo() $path = '/directory/file.pdf'; $this->assertEquals([ - 'dirname' => '/directory', - 'basename' => 'file.pdf', - 'filename' => 'file', + 'dirname' => '/directory', + 'basename' => 'file.pdf', + 'filename' => 'file', 'extension' => 'pdf', ], $this->modify($path)); } diff --git a/tests/Permissions/PermissionsTest.php b/tests/Permissions/PermissionsTest.php index 8d97acab78..f0ccb679a7 100644 --- a/tests/Permissions/PermissionsTest.php +++ b/tests/Permissions/PermissionsTest.php @@ -326,7 +326,7 @@ public function setupComplicatedTest($permissions) $permission->children([ $permissions->make('replaced child {placeholder}')->label('Replaced :placeholder')->children([ $permissions->make('replaced nested child {placeholder}') - ->label('Replaced Nested :placeholder'), + ->label('Replaced Nested :placeholder'), ]), ])->replacements('placeholder', function () { return [ diff --git a/tests/StaticCaching/FullMeasureStaticCachingTest.php b/tests/StaticCaching/FullMeasureStaticCachingTest.php index e81088dff2..18b0781c93 100644 --- a/tests/StaticCaching/FullMeasureStaticCachingTest.php +++ b/tests/StaticCaching/FullMeasureStaticCachingTest.php @@ -5,7 +5,6 @@ use Statamic\Facades\File; use Statamic\Facades\StaticCache; use Statamic\StaticCaching\NoCache\Session; -use Symfony\Component\HttpFoundation\Response; use Tests\FakesContent; use Tests\FakesViews; use Tests\PreventSavingStacheItemsToDisk; diff --git a/tests/Support/HtmlTest.php b/tests/Support/HtmlTest.php index 12a3abf55e..ae2fe48766 100644 --- a/tests/Support/HtmlTest.php +++ b/tests/Support/HtmlTest.php @@ -10,7 +10,7 @@ class HtmlTest extends TestCase public function testDl() { $list = [ - 'foo' => 'bar', + 'foo' => 'bar', 'bing' => 'baz', ]; diff --git a/tests/TestCase.php b/tests/TestCase.php index f4e97d35af..88b0417a6a 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,8 +15,6 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase protected function setUp(): void { - require_once __DIR__.'/ConsoleKernel.php'; - parent::setUp(); $this->withoutVite(); diff --git a/tests/Translator/__fixtures__/php/test.php b/tests/Translator/__fixtures__/php/test.php index 3fb8fba8ff..134ae2dea7 100644 --- a/tests/Translator/__fixtures__/php/test.php +++ b/tests/Translator/__fixtures__/php/test.php @@ -1,6 +1,6 @@ once() ->with('Cannot render an object variable as a string: {{ object }}'); - $object = new class { + $object = new class + { }; $this->assertEquals('', $this->renderString('{{ object }}', compact('object'))); @@ -1748,7 +1749,8 @@ public function it_can_reach_into_the_cascade() $m->shouldNotReceive('get')->with('augmented'); }); - $fieldtype = new class extends Fieldtype { + $fieldtype = new class extends Fieldtype + { }; $augmented = new Value(['drink' => 'la croix'], 'augmented', $fieldtype); @@ -2211,7 +2213,8 @@ public function when_a_loop_is_a_value_object_with_an_empty_array_it_get_parsed_ after EOT; $this->assertEquals($expected, $this->renderString($template, [ - 'simple' => new Value([], null, new class extends \Statamic\Fieldtypes\Replicator { + 'simple' => new Value([], null, new class extends \Statamic\Fieldtypes\Replicator + { }), ])); } @@ -2451,7 +2454,8 @@ public function __call($method, $args) return 'foo'; } }, ], - 'without __call or __toString' => [new class() { + 'without __call or __toString' => [new class() + { // }, ], ];