Skip to content

Commit

Permalink
Merge pull request #72 from sunrise-php/release/v1.2.0
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
fenric authored Apr 19, 2022
2 parents 44c07d5 + 8920a56 commit afdc556
Show file tree
Hide file tree
Showing 16 changed files with 155 additions and 120 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,40 @@ jobs:
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --prefer-source --no-suggest
- run: php vendor/bin/phpunit --colors=always
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php72:
docker:
- image: circleci/php:7.2-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --prefer-source --no-suggest
- run: php vendor/bin/phpunit --colors=always
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php73:
docker:
- image: circleci/php:7.3-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --prefer-source --no-suggest
- run: php vendor/bin/phpunit --colors=always
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php74:
docker:
- image: circleci/php:7.4-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --prefer-source --no-suggest
- run: php vendor/bin/phpunit --colors=always
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
php80:
docker:
- image: circleci/php:8.0-cli-node-browsers
steps:
- checkout
- run: php -v
- run: composer install --no-interaction --prefer-source --no-suggest
- run: php vendor/bin/phpunit --colors=always
- run: composer install --no-interaction
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
workflows:
version: 2
build:
Expand Down
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@ indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
17 changes: 9 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.php_cs.cache
.phpunit.result.cache
composer.lock
coverage.xml
phpbench.json
phpcs.xml
phpunit.xml
vendor/
/.php_cs.cache
/.phpunit.result.cache
/composer.lock
/coverage.xml
/phpbench.json
/phpcs.xml
/phpunit.xml
/psalm.xml
/vendor/
5 changes: 4 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
build:
environment:
php:
version: '8.0'
nodes:
analysis:
tests:
Expand All @@ -7,7 +10,7 @@ build:
coverage:
tests:
override:
- command: php vendor/bin/phpunit --coverage-clover coverage.xml
- command: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-clover coverage.xml
coverage:
file: coverage.xml
format: clover
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Sunrise // PHP
Copyright (c) 2018 Anatoly Nekhay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Simple VIN decoder for PHP 7.1+ (incl. PHP 8) based on ISO-3779
## Simple VIN decoder for PHP 7.1+ based on ISO-3779

[![Gitter](https://badges.gitter.im/sunrise-php/support.png)](https://gitter.im/sunrise-php/support)
[![Build Status](https://circleci.com/gh/sunrise-php/vin.svg?style=shield)](https://circleci.com/gh/sunrise-php/vin)
Expand Down Expand Up @@ -26,14 +26,20 @@ try {
// It isn't a valid VIN...
}

$vin->getVin(); // returns "WVWZZZ1KZ6W612305"
$vin->getWmi(); // returns "WVW"
$vin->getVds(); // returns "ZZZ1KZ"
$vin->getVis(); // returns "6W612305"
$vin->getRegion(); // returns "Europe"
$vin->getCountry(); // returns "Germany"
$vin->getManufacturer(); // returns "Volkswagen"
$vin->getModelYear(); // returns [2006]
$vin->getVin(); // "WVWZZZ1KZ6W612305"
$vin->getWmi(); // "WVW"
$vin->getVds(); // "ZZZ1KZ"
$vin->getVis(); // "6W612305"
$vin->getRegion(); // "Europe"
$vin->getCountry(); // "Germany"
$vin->getManufacturer(); // "Volkswagen"
$vin->getModelYear(); // [2006]

// convert the VIN to a string
(string) $vin;

// converts the VIN to array
$vin->toArray();
```

## Useful links
Expand Down
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sunrise/vin",
"homepage": "https://github.com/sunrise-php/vin",
"description": "Simple VIN decoder for PHP 7.1+ based on ISO-3779",
"description": "VIN decoder for PHP 7.1+ based on ISO-3779",
"license": "MIT",
"keywords": [
"fenric",
Expand All @@ -15,8 +15,8 @@
"authors": [
{
"name": "Anatoly Fenric",
"email": "anatoly@fenric.ru",
"homepage": "https://anatoly.fenric.ru/"
"email": "afenric@gmail.com",
"homepage": "https://github.com/fenric"
},
{
"name": "李昀陞 (Peter)",
Expand Down Expand Up @@ -48,8 +48,13 @@
},
"scripts": {
"test": [
"phpunit --colors=always --coverage-text",
"phpcs"
"phpcs",
"psalm",
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
],
"build": [
"phpdoc -d src/ -t phpdoc/",
"XDEBUG_MODE=coverage phpunit --coverage-html coverage/"
]
}
}
2 changes: 1 addition & 1 deletion data/manufacturers.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* List of all manufacturers
*
* @var array
* @var array<string, string>
*
* @link https://en.wikipedia.org/wiki/Vehicle_identification_number#List_of_common_WMI
* @link https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)#List_of_all_WMIs
Expand Down
5 changes: 4 additions & 1 deletion data/regions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
/**
* List of all regions
*
* @var array
* @var array<string, array{
* region: string,
* countries: array<string, string>,
* }>
*
* @link https://en.wikipedia.org/wiki/Vehicle_identification_number#Country_or_Region_codes
* @link https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)#WMI_Regions
Expand Down
2 changes: 1 addition & 1 deletion data/years.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* List of all model years
*
* @var array
* @var array<int, string>
*
* @link https://en.wikipedia.org/wiki/Vehicle_identification_number#Model_year_encoding
* @link https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Model_year
Expand Down
7 changes: 5 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0"?>
<phpunit colors="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory>./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Sunrise VIN Test Suite">
<testsuite name="sunrise/vin">
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand Down
14 changes: 14 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
Loading

0 comments on commit afdc556

Please sign in to comment.