Skip to content

Commit

Permalink
Craft 5, PHP8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Leoncio, Leo committed Mar 27, 2024
1 parent 0220c7b commit 4a18a88
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 52 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to this project will be documented in this file.

## 2.0.0 - 2024.03.26
### Craft 5, PHP 8.2

## 1.0.3 - 2023.03.24
### Cleanup, PHP 8.1

Expand Down
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

18 changes: 10 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"bots",
"spiders"
],
"version": "1.0.3",
"version": "2.0.0",
"type": "craft-plugin",
"license": "MIT",
"license": "proprietary",
"authors": [
{
"name": "Leo",
Expand All @@ -19,14 +19,15 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^8.0.2",
"craftcms/cms": "^4.0",
"jaybizzle/crawler-detect": "^v1.2"
"php": "^8.2",
"craftcms/cms": "^5.0",
"jaybizzle/crawler-detect": "^1.2"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main"
"craftcms/rector": "dev-main",
"laravel/pint": "^1.14.0"
},
"autoload": {
"psr-4": {
Expand All @@ -40,7 +41,7 @@
},
"config": {
"platform": {
"php": "8.0.2"
"php": "8.2"
},
"allow-plugins": {
"yiisoft/yii2-composer": true,
Expand All @@ -51,6 +52,7 @@
"check-cs": "vendor/bin/ecs check src --ansi",
"fix-cs": "vendor/bin/ecs check src --ansi --fix",
"phpstan": "vendor/bin/phpstan analyse src",
"rector": "vendor/bin/rector process src --config vendor/craftcms/rector/sets/craft-cms-40.php"
"rector": "vendor/bin/rector process src --config vendor/craftcms/rector/sets/craft-cms-50.php",
"pint": "vendor/bin/pint -v src"
}
}
43 changes: 43 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"preset": "psr12",
"rules": {
"braces": false,
"concat_space": {
"spacing": "one"
},
"new_with_braces": {
"anonymous_class": false,
"named_class": false
},
"phpdoc_separation": false,
"simplified_null_return": true,
"array_syntax": {
"syntax": "short"
},
"binary_operator_spaces": true,
"blank_line_before_statement": false,
"cast_spaces": false,
"class_attributes_separation": false,
"declare_equal_normalize": true,
"function_declaration": false,
"method_argument_space": false,
"multiline_whitespace_before_semicolons": false,
"no_empty_statement": true,
"no_leading_import_slash": true,
"no_leading_namespace_whitespace": true,
"no_multiline_whitespace_around_double_arrow": true,
"no_unused_imports": true,
"no_whitespace_before_comma_in_array": true,
"no_whitespace_in_blank_line": true,
"not_operator_with_successor_space": false,
"ordered_imports": true,
"phpdoc_add_missing_param_annotation": false,
"phpdoc_align": false,
"phpdoc_indent": false,
"phpdoc_order": true,
"phpdoc_scalar": true,
"single_line_after_imports": false,
"single_space_around_construct": false,
"trim_array_spaces": true
}
}
7 changes: 0 additions & 7 deletions src/Detect.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @author Leo Leoncio
* @see https://github.com/leowebguy
* @copyright Copyright (c) 2023, leowebguy
* @license MIT
*/

namespace leowebguy\crawlerdetect;
Expand All @@ -19,16 +18,10 @@

class Detect extends Plugin
{
// Properties
// =========================================================================

public bool $hasCpSection = false;

public bool $hasCpSettings = false;

// Public Methods
// =========================================================================

public function init()
{
parent::init();
Expand Down
18 changes: 2 additions & 16 deletions src/variables/DetectVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @author Leo Leoncio
* @see https://github.com/leowebguy
* @copyright Copyright (c) 2023, leowebguy
* @license MIT
*/

namespace leowebguy\crawlerdetect\variables;
Expand All @@ -15,31 +14,18 @@

class DetectVariable
{
// Properties
// =========================================================================

private CrawlerDetect $crawlerDetect;

// Construct
// =========================================================================

public function __construct()
{
$this->crawlerDetect = new CrawlerDetect();
$this->crawlerDetect = new CrawlerDetect;
}

/**
* @return string
*/
public function getCrawlerDetect(): string
public function getCrawlerDetect(): CrawlerDetect
{
return $this->crawlerDetect;
}

/**
* @param $userAgent
* @return bool
*/
public function isCrawler($userAgent = null): bool
{
return $this->crawlerDetect->isCrawler($userAgent);
Expand Down

0 comments on commit 4a18a88

Please sign in to comment.