Skip to content

Commit 98b5f20

Browse files
authored
Merge pull request #5 from demyanovs/release-2.1.0
Release 2.1.0
2 parents 6c8e27c + 513ca15 commit 98b5f20

18 files changed

+221
-85
lines changed

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
## [2.0.0] - 2023-06-03
2424
- Completely redesigned project structure
2525
- Updated syntaxes to PHP 8.1
26-
- Updated examples
26+
- Updated examples
27+
-
28+
## [2.1.0] - 2023-06-13
29+
- Set PHP minimum version in composer
30+
- Throws UnknownThemeException
31+
- Added tests

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ See full example here [index.php](../master/examples/index.php)
2626
require_once 'vendor/autoload.php';
2727

2828
use Demyanovs\PHPHighlight\Highlighter;
29+
use Demyanovs\PHPHighlight\Themes\ObsidianTheme;
2930

3031
$text = '
3132
<pre data-file="php-highlight/examples/index.php" data-lang="php">

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
}
1818
],
1919
"require": {
20+
"php": ">=8.1"
2021
},
2122
"autoload": {
2223
"psr-4": {

examples/css/highlighter.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,3 @@
5454
.code-highlighter .line-number {
5555
display: block;
5656
}
57-
58-
.code-block-wrapper .copy-text {
59-
font-size: 16px;
60-
cursor: pointer;
61-
}

phpcs.xml.dist

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
<!-- Include full Doctrine Coding Standard -->
1818
<rule ref="Doctrine">
1919
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing"/>
20+
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable"/>
21+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter"/>
2022
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFallbackGlobalName"/>
21-
<exclude name="SlevomatCodingStandard.Variables.UselessVariable.UselessVariable"/>
2223
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/>
24+
<exclude name="SlevomatCodingStandard.Variables.UselessVariable.UselessVariable"/>
2325
<exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod"/>
26+
<exclude name="SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty"/>
27+
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix"/>
2428
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLineDocComment.MultiLineDocComment"/>
2529
<exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed"/>
2630
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion.RequiredExplicitAssertion"/>
27-
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat.DisallowedShortNullable"/>
28-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter"/>
29-
<exclude name="SlevomatCodingStandard.Classes.PropertyDeclaration.MultipleSpacesBetweenTypeHintAndProperty"/>
3031
<exclude name="Generic.Formatting.SpaceAfterNot.Incorrect"/>
3132
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSame"/>
3233
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint"/>
3334
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.NewlineBeforeOpenBrace"/>
3435
</rule>
3536

3637
<exclude-pattern>examples/</exclude-pattern>
37-
<exclude-pattern>src/Traits</exclude-pattern>
3838
</ruleset>

src/Highlighter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Highlighter
1515
private bool $showActionPanel = true;
1616

1717
private Theme $theme;
18+
1819
private ThemePool $themePool;
1920

2021
/**

src/Themes/C64Theme.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ public function __construct()
2222
'#588D43;',
2323
);
2424

25-
$XMLColorSchemaDto = new XMLColorSchemaDto(
26-
'#70A4B2; font-weight;',
27-
'#9A6759;',
28-
'#9AD284;',
29-
'#6C6C6C;',
30-
);
31-
3225
$PHPColorSchemaDto = new PHPColorSchemaDto(
3326
'#FFFFFF;',
3427
'#9AD284;',
@@ -37,6 +30,13 @@ public function __construct()
3730
'#B8C76F;',
3831
);
3932

33+
$XMLColorSchemaDto = new XMLColorSchemaDto(
34+
'#70A4B2; font-weight;',
35+
'#9A6759;',
36+
'#9AD284;',
37+
'#6C6C6C;',
38+
);
39+
4040
parent::__construct(self::TITLE, $defaultColorSchemaDto, $PHPColorSchemaDto, $XMLColorSchemaDto);
4141
}
4242
}

src/Themes/DarkulaTheme.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ public function __construct()
2222
'#cb7832;',
2323
);
2424

25-
$XMLColorSchemaDto = new XMLColorSchemaDto(
26-
'#cb7832;',
27-
'#bababa;',
28-
'#6896ba;',
29-
'#7f7f7f;',
30-
);
31-
3225
$PHPColorSchemaDto = new PHPColorSchemaDto(
3326
'#bababa;',
3427
'#7f7f7f; font-weight: bold;',
@@ -37,6 +30,13 @@ public function __construct()
3730
'#6a8759;',
3831
);
3932

33+
$XMLColorSchemaDto = new XMLColorSchemaDto(
34+
'#cb7832;',
35+
'#bababa;',
36+
'#6896ba;',
37+
'#7f7f7f;',
38+
);
39+
4040
parent::__construct(self::TITLE, $defaultColorSchemaDto, $PHPColorSchemaDto, $XMLColorSchemaDto);
4141
}
4242
}

src/Themes/DefaultTheme.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ public function __construct()
2222
'#cb7832;',
2323
);
2424

25-
$XMLColorSchemaDto = new XMLColorSchemaDto(
26-
'#008000;',
27-
'#7D9029;',
28-
'#BA2121;',
29-
'#BC7A00;',
30-
);
31-
3225
$PHPColorSchemaDto = new PHPColorSchemaDto(
3326
'#0000BB;',
3427
'#FF8000;',
@@ -37,6 +30,13 @@ public function __construct()
3730
'#DD0000;',
3831
);
3932

33+
$XMLColorSchemaDto = new XMLColorSchemaDto(
34+
'#008000;',
35+
'#7D9029;',
36+
'#BA2121;',
37+
'#BC7A00;',
38+
);
39+
4040
parent::__construct(self::TITLE, $defaultColorSchemaDto, $PHPColorSchemaDto, $XMLColorSchemaDto);
4141
}
4242
}

0 commit comments

Comments
 (0)