Skip to content

Commit

Permalink
Issue #210: validate line ending and file encodings
Browse files Browse the repository at this point in the history
Signed-off-by: alexmerlin <[email protected]>
  • Loading branch information
alexmerlin committed Jan 5, 2024
1 parent 93cb43c commit 30692ee
Show file tree
Hide file tree
Showing 16 changed files with 2,591 additions and 2,559 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check-encoding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
- push

name: Check File Encodings

jobs:
check_encoding:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check file encodings
run: |
find . -type f ! -path "./.git/*" -exec sh -c '
for file do
encoding=$(file -bi "$file" | awk -F "=" '{print $2}')
if [ "$encoding" != "utf-8" ]; then
echo "File $file has encoding $encoding"
exit 1
fi
done
' sh {} +
8 changes: 8 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="encoding" value="utf-8"/>

<!-- Show progress -->
<arg value="p"/>
Expand All @@ -21,4 +22,11 @@

<!-- Include all rules from the Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.EndFileNewline"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
</ruleset>
18 changes: 9 additions & 9 deletions public/images/app/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>
2 changes: 1 addition & 1 deletion src/Admin/src/Adapter/AuthenticationAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private function validateConfig(): void
/**
* @throws Exception
*/
private function checkMethod(Admin $identityClass, string $methodName): void
private function checkMethod(Admin $identityClass, string $methodName, int $a): void
{
if (! method_exists($identityClass, $methodName)) {
throw new Exception(sprintf(
Expand Down
18 changes: 9 additions & 9 deletions src/App/assets/images/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>
60 changes: 30 additions & 30 deletions src/App/assets/js/components/_language.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
$(document).ready(function () {
$(document).on('click', '.language-container .language-active', function () {
$(".language-list").slideToggle("fast");
});

$(document).on('click', '.language-container .language', function () {
let language = $(this);
let languageKey = $(this).data('language-key');
let langImageSrc = language.find('img').attr('src');

$('.language-container .language-active').find('img').attr('src', langImageSrc);

$(".language-list").slideToggle("fast");
$(".language-list .language").removeClass('active');

$.post(
'/language/change',
{
'languageKey': languageKey
}
)
.done(function () {
// activate language in list
language.addClass('active');

// reload page
location.reload();
});
});
});
$(document).ready(function () {
$(document).on('click', '.language-container .language-active', function () {
$(".language-list").slideToggle("fast");
});

$(document).on('click', '.language-container .language', function () {
let language = $(this);
let languageKey = $(this).data('language-key');
let langImageSrc = language.find('img').attr('src');

$('.language-container .language-active').find('img').attr('src', langImageSrc);

$(".language-list").slideToggle("fast");
$(".language-list .language").removeClass('active');

$.post(
'/language/change',
{
'languageKey': languageKey
}
)
.done(function () {
// activate language in list
language.addClass('active');

// reload page
location.reload();
});
});
});
12 changes: 6 additions & 6 deletions src/App/assets/js/components/_profile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(document).ready(function () {
/* Search patterns */
$('.collapse-menu').on('click', function () {
$('.profile-action-menu').slideToggle();
});
});
$(document).ready(function () {
/* Search patterns */
$('.collapse-menu').on('click', function () {
$('.profile-action-menu').slideToggle();
});
});
Loading

0 comments on commit 30692ee

Please sign in to comment.