Skip to content

Commit

Permalink
fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
soulaimaneyahya committed Mar 30, 2024
1 parent 16932d7 commit f3e5991
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/bash

# cd ./git/hooks
# mv commit-msg.sample commit-msg
# Don't forget to add: chmod +x .git/hooks/commit-msg

COMMIT_MESSAGE=$(cat $1)

if [[ ! $COMMIT_MESSAGE =~ ^(feat|fix|refactor|test|docs|core) ]]; then
echo "Error: Commit message must start with one of the following keywords: feat, fix, refactor, test, docs, core."
exit 1
fi

exit 0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/composer.lock
.idea/
.TODO
.php-cs-fixer.cache
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
"scripts": {
"test": "vendor/bin/phpunit tests/Feature",
"php-psr": [
"./vendor/bin/phpcs --standard=PSR2 --encoding=utf-8 --extensions=php src/* tests/*"
"find src -type f -name \"*.php\" -print0 | xargs -0 -n1 php -lf",
"vendor/bin/php-cs-fixer fix --allow-risky=yes src --rules=declare_strict_types,@PSR12",
"./vendor/bin/phpcs --standard=PSR2 --encoding=utf-8 --extensions=php src/*"
]
},
"minimum-stability": "dev",
Expand All @@ -34,7 +36,9 @@
},
"require-dev": {
"squizlabs/php_codesniffer": "4.0.x-dev",
"phpunit/phpunit": "9.6.x-dev"
"phpunit/phpunit": "9.6.x-dev",
"orchestra/testbench": "8.x-dev",
"friendsofphp/php-cs-fixer": "dev-master"
},
"config": {
"optimize-autoloader": true
Expand Down
9 changes: 5 additions & 4 deletions src/MultividasCard.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Copyright (c) 2023 by Soulaimane Yahya.
* All rights reserved.
Expand All @@ -16,22 +18,21 @@

class MultividasCard
{

/**
* Library version
*
* @since 1.0
* @var string
*/
const VERSION = '1.1.1';
public const VERSION = '1.1.1';

/**
* Multividas prefix
*
* @since 1.0
* @var string
*/
const PREFIX = 'multividas';
public const PREFIX = 'multividas';

/**
* String properties
Expand Down Expand Up @@ -176,7 +177,7 @@ public function toArray(): array
if (!$this->requiredPropertiesExist()) {
return array();
}

// initialize with required properties
$card = [
'card' => $this->card,
Expand Down

0 comments on commit f3e5991

Please sign in to comment.