Skip to content

Commit

Permalink
initial 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Aug 30, 2024
1 parent 3bbc185 commit 3b57ae9
Show file tree
Hide file tree
Showing 191 changed files with 171 additions and 8,349 deletions.
14 changes: 6 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Read about configuration, here:
# https://craftcms.com/docs/4.x/config/
# https://craftcms.com/docs/5.x/configure.html

# The application ID used to to uniquely store session and cache data, mutex locks, and more
CRAFT_APP_ID=

# The environment Craft is currently running in (dev, staging, production, etc.)
CRAFT_ENVIRONMENT=dev

# The secure key Craft will use for hashing and encrypting data
CRAFT_SECURITY_KEY=

# Database connection settings
CRAFT_DB_DRIVER=mysql
CRAFT_DB_SERVER=127.0.0.1
Expand All @@ -20,8 +17,9 @@ CRAFT_DB_PASSWORD=
CRAFT_DB_SCHEMA=public
CRAFT_DB_TABLE_PREFIX=

# General settings (see config/general.php)
DEV_MODE=true
ALLOW_ADMIN_CHANGES=true
DISALLOW_ROBOTS=true
# General settings
CRAFT_SECURITY_KEY=
CRAFT_DEV_MODE=true
CRAFT_ALLOW_ADMIN_CHANGES=true
CRAFT_DISALLOW_ROBOTS=true
CRAFT_RUN_QUEUE_AUTOMATICALLY=false
14 changes: 14 additions & 0 deletions .phpstorm.meta/craft.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace yii\di {
class Container {
/**
* @template T
* @param class-string<T> $class
* @return T
*/
function get(string $class) {

}
}
}
11 changes: 4 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"markhuot\\keystone\\tests\\": "tests/"
},
"files": [
"src/helpers/event.php",
"src/helpers/data.php",
"src/helpers/base.php"
]
},
Expand All @@ -22,10 +20,10 @@
}
],
"require-dev": {
"markhuot/craft-pest-core": "dev-main",
"markhuot/craft-pest-core": "dev-craft5",
"phpstan/phpstan": "^1.10",
"laravel/pint": "^1.13",
"craftcms/craft": "dev-main"
"craftcms/craft": "^5.0.1"
},
"extra": {
"name": "Keystone",
Expand All @@ -44,8 +42,7 @@
}
},
"require": {
"craftcms/cms": "^4.5.7",
"nikic/php-parser": "^4.17",
"sebastian/comparator": "^5.0@dev"
"craftcms/cms": "^5.0.1",
"craftcms/phpstan": "dev-main"
}
}
23 changes: 13 additions & 10 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
parameters:
level: 9
level: max
paths:
- src
stubFiles:
- .phpstorm.meta/craft.php
scanFiles:
- %currentWorkingDirectory%/vendor/yiisoft/yii2/Yii.php
- %currentWorkingDirectory%/vendor/craftcms/cms/src/Craft.php
- %currentWorkingDirectory%/vendor/craftcms/cms/src/behaviors/CustomFieldBehavior.php.template
excludePaths:
- %currentWorkingDirectory%/src/phpstan/ThrowIfTypeSpecifyingExtension.php
- %currentWorkingDirectory%/src/phpstan/AbortIfFunctionTypeSpecifyingExtension.php
ignoreErrors:
- '#Unable to resolve the template type TMapValue in call to method#'
- '#Unable to resolve the template type T in call to method craft\\services\\Elements::getElementById\(\)#'
- vendor/yiisoft/yii2/Yii.php
- vendor/craftcms/cms/src/Craft.php
- vendor/craftcms/cms/src/behaviors/CustomFieldBehavior.php.template
earlyTerminatingMethodCalls:
Craft:
- dd
yii\base\Application:
- end
yii\base\ErrorHandler:
- convertExceptionToError
14 changes: 2 additions & 12 deletions src/Keystone.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use markhuot\keystone\listeners\RegisterCpUrlRules;
use markhuot\keystone\listeners\RegisterDefaultAttributeTypes;
use markhuot\keystone\listeners\RegisterDefaultComponentTypes;
use markhuot\keystone\listeners\RegisterKeystoneFieldAsMatrixCompatible;
use markhuot\keystone\listeners\RegisterKeystoneFieldType;
use markhuot\keystone\listeners\RegisterTwigExtensions;
use markhuot\keystone\models\Component;
Expand All @@ -31,19 +32,8 @@ class Keystone extends Plugin
protected function getListeners(): array
{
return [
[WebApplication::class, WebApplication::EVENT_BEFORE_REQUEST, AttachPerRequestBehaviors::class],
[Fields::class, Fields::EVENT_REGISTER_FIELD_TYPES, RegisterKeystoneFieldType::class],
[UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, RegisterCpUrlRules::class],
[GetComponentType::class, GetComponentType::EVENT_REGISTER_COMPONENT_TYPES, RegisterDefaultComponentTypes::class],
[GetComponentType::class, GetComponentType::EVENT_REGISTER_COMPONENT_TYPES, DiscoverSiteComponentTypes::class],
[GetAttributeTypes::class, GetAttributeTypes::EVENT_REGISTER_ATTRIBUTE_TYPE, RegisterDefaultAttributeTypes::class],
[Element::class, Element::EVENT_DEFINE_BEHAVIORS, AttachElementBehaviors::class],
[PlainText::class, PlainText::EVENT_DEFINE_BEHAVIORS, AttachFieldBehavior::class],
[Query::class, Query::EVENT_DEFINE_BEHAVIORS, AttachQueryBehaviors::class],
[Component::class, Component::AFTER_POPULATE_TREE, EagerLoadComponents::class],
[Plugin::class, Plugin::EVENT_INIT, MarkClassesSafeForTwig::class],
[Plugin::class, Plugin::EVENT_INIT, RegisterTwigExtensions::class],
[Plugin::class, Plugin::EVENT_INIT, RegisterCollectionMacros::class],
[Fields::class, Fields::EVENT_DEFINE_COMPATIBLE_FIELD_TYPES, RegisterKeystoneFieldAsMatrixCompatible::class],
];
}
}
105 changes: 0 additions & 105 deletions src/actions/AddComponent.php

This file was deleted.

126 changes: 0 additions & 126 deletions src/actions/CompileTwigComponent.php

This file was deleted.

30 changes: 0 additions & 30 deletions src/actions/DeleteComponent.php

This file was deleted.

Loading

0 comments on commit 3b57ae9

Please sign in to comment.