Skip to content

Commit

Permalink
Merge branch 'release/5.0.1' into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jun 18, 2024
2 parents 2ee1efa + fe9c67a commit 883b044
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Typogrify Changelog

## 5.0.1 - 2024.06.18
### Added
* Added `ServicesTrait` for the plugin service component registration

## 5.0.0 - 2024.04.16
### Added
* Stable release for Craft CMS 5
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-typogrify",
"description": "Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more",
"type": "craft-plugin",
"version": "5.0.0",
"version": "5.0.1",
"keywords": [
"craft",
"cms",
Expand Down
32 changes: 12 additions & 20 deletions src/Typogrify.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify;
Expand All @@ -15,7 +15,7 @@
use craft\base\Plugin;
use craft\web\twig\variables\CraftVariable;
use nystudio107\typogrify\models\Settings;
use nystudio107\typogrify\services\TypogrifyService;
use nystudio107\typogrify\services\ServicesTrait;
use nystudio107\typogrify\twigextensions\TypogrifyTwigExtension;
use nystudio107\typogrify\variables\TypogrifyVariable;
use yii\base\Event;
Expand All @@ -28,22 +28,26 @@
* @since 1.0.0
*
* @property Settings $settings
* @property TypogrifyService $typogrify
*/
class Typogrify extends Plugin
{
// Traits
// =========================================================================

use ServicesTrait;

// Static Properties
// =========================================================================

/**
* @var Typogrify
* @var ?Typogrify
*/
public static $plugin;
public static ?Typogrify $plugin = null;

/**
* @var TypogrifyVariable
* @var ?TypogrifyVariable
*/
public static $variable;
public static ?TypogrifyVariable $variable = null;

// Public Properties
// =========================================================================
Expand All @@ -65,18 +69,6 @@ class Typogrify extends Plugin
// Public Methods
// =========================================================================

/**
* @inheritdoc
*/
public function __construct($id, $parent = null, array $config = [])
{
$config['components'] = [
'typogrify' => TypogrifyService::class,
];

parent::__construct($id, $parent, $config);
}

/**
* @inheritdoc
*/
Expand Down
4 changes: 2 additions & 2 deletions src/config.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

use PHP_Typography\Settings\Dash_Style;
Expand Down
4 changes: 2 additions & 2 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify\models;
Expand Down
53 changes: 53 additions & 0 deletions src/services/ServicesTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and
* 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify\services;

use yii\base\InvalidConfigException;

/**
* @author nystudio107
* @package Typogrify
* @since 1.0.0
*
* @property TypogrifyService $typogrify
*/
trait ServicesTrait
{
// Public Static Methods
// =========================================================================

/**
* @inheritdoc
*/
public static function config(): array
{
return [
'components' => [
'typogrify' => TypogrifyService::class,
],
];
}

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

/**
* Returns the typogrify service
*
* @return TypogrifyService The typogrify service
* @throws InvalidConfigException
*/
public function getTypogrify(): TypogrifyService
{
return $this->get('typogrify');
}
}
4 changes: 2 additions & 2 deletions src/services/TypogrifyService.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and
* 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify\services;
Expand Down
4 changes: 2 additions & 2 deletions src/translations/en/typogrify.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

/**
Expand Down
4 changes: 2 additions & 2 deletions src/twigextensions/TypogrifyTwigExtension.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify\twigextensions;
Expand Down
4 changes: 2 additions & 2 deletions src/variables/TypogrifyVariable.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php
/**
* Typogrify plugin for Craft CMS 3.x
* Typogrify plugin for Craft CMS
*
* Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
*
* @link https://nystudio107.com/
* @copyright Copyright (c) 2017 nystudio107
* @copyright Copyright (c) nystudio107
*/

namespace nystudio107\typogrify\variables;
Expand Down

0 comments on commit 883b044

Please sign in to comment.