Skip to content

Commit afdc556

Browse files
authored
Merge pull request #72 from sunrise-php/release/v1.2.0
v1.2.0
2 parents 44c07d5 + 8920a56 commit afdc556

File tree

16 files changed

+155
-120
lines changed

16 files changed

+155
-120
lines changed

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ jobs:
1010
steps:
1111
- checkout
1212
- run: php -v
13-
- run: composer install --no-interaction --prefer-source --no-suggest
14-
- run: php vendor/bin/phpunit --colors=always
13+
- run: composer install --no-interaction
14+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
1515
php72:
1616
docker:
1717
- image: circleci/php:7.2-cli-node-browsers
1818
steps:
1919
- checkout
2020
- run: php -v
21-
- run: composer install --no-interaction --prefer-source --no-suggest
22-
- run: php vendor/bin/phpunit --colors=always
21+
- run: composer install --no-interaction
22+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
2323
php73:
2424
docker:
2525
- image: circleci/php:7.3-cli-node-browsers
2626
steps:
2727
- checkout
2828
- run: php -v
29-
- run: composer install --no-interaction --prefer-source --no-suggest
30-
- run: php vendor/bin/phpunit --colors=always
29+
- run: composer install --no-interaction
30+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
3131
php74:
3232
docker:
3333
- image: circleci/php:7.4-cli-node-browsers
3434
steps:
3535
- checkout
3636
- run: php -v
37-
- run: composer install --no-interaction --prefer-source --no-suggest
38-
- run: php vendor/bin/phpunit --colors=always
37+
- run: composer install --no-interaction
38+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
3939
php80:
4040
docker:
4141
- image: circleci/php:8.0-cli-node-browsers
4242
steps:
4343
- checkout
4444
- run: php -v
45-
- run: composer install --no-interaction --prefer-source --no-suggest
46-
- run: php vendor/bin/phpunit --colors=always
45+
- run: composer install --no-interaction
46+
- run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text
4747
workflows:
4848
version: 2
4949
build:

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ indent_size = 4
1111
trim_trailing_whitespace = true
1212
insert_final_newline = true
1313

14-
[*.md]
15-
trim_trailing_whitespace = false
16-
1714
[*.yml]
1815
indent_size = 2

.gitignore

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
.php_cs.cache
2-
.phpunit.result.cache
3-
composer.lock
4-
coverage.xml
5-
phpbench.json
6-
phpcs.xml
7-
phpunit.xml
8-
vendor/
1+
/.php_cs.cache
2+
/.phpunit.result.cache
3+
/composer.lock
4+
/coverage.xml
5+
/phpbench.json
6+
/phpcs.xml
7+
/phpunit.xml
8+
/psalm.xml
9+
/vendor/

.scrutinizer.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
build:
2+
environment:
3+
php:
4+
version: '8.0'
25
nodes:
36
analysis:
47
tests:
@@ -7,7 +10,7 @@ build:
710
coverage:
811
tests:
912
override:
10-
- command: php vendor/bin/phpunit --coverage-clover coverage.xml
13+
- command: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-clover coverage.xml
1114
coverage:
1215
file: coverage.xml
1316
format: clover

.travis.yml

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Sunrise // PHP
3+
Copyright (c) 2018 Anatoly Nekhay
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Simple VIN decoder for PHP 7.1+ (incl. PHP 8) based on ISO-3779
1+
## Simple VIN decoder for PHP 7.1+ based on ISO-3779
22

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

29-
$vin->getVin(); // returns "WVWZZZ1KZ6W612305"
30-
$vin->getWmi(); // returns "WVW"
31-
$vin->getVds(); // returns "ZZZ1KZ"
32-
$vin->getVis(); // returns "6W612305"
33-
$vin->getRegion(); // returns "Europe"
34-
$vin->getCountry(); // returns "Germany"
35-
$vin->getManufacturer(); // returns "Volkswagen"
36-
$vin->getModelYear(); // returns [2006]
29+
$vin->getVin(); // "WVWZZZ1KZ6W612305"
30+
$vin->getWmi(); // "WVW"
31+
$vin->getVds(); // "ZZZ1KZ"
32+
$vin->getVis(); // "6W612305"
33+
$vin->getRegion(); // "Europe"
34+
$vin->getCountry(); // "Germany"
35+
$vin->getManufacturer(); // "Volkswagen"
36+
$vin->getModelYear(); // [2006]
37+
38+
// convert the VIN to a string
39+
(string) $vin;
40+
41+
// converts the VIN to array
42+
$vin->toArray();
3743
```
3844

3945
## Useful links

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sunrise/vin",
33
"homepage": "https://github.com/sunrise-php/vin",
4-
"description": "Simple VIN decoder for PHP 7.1+ based on ISO-3779",
4+
"description": "VIN decoder for PHP 7.1+ based on ISO-3779",
55
"license": "MIT",
66
"keywords": [
77
"fenric",
@@ -15,8 +15,8 @@
1515
"authors": [
1616
{
1717
"name": "Anatoly Fenric",
18-
"email": "anatoly@fenric.ru",
19-
"homepage": "https://anatoly.fenric.ru/"
18+
"email": "afenric@gmail.com",
19+
"homepage": "https://github.com/fenric"
2020
},
2121
{
2222
"name": "李昀陞 (Peter)",
@@ -48,8 +48,13 @@
4848
},
4949
"scripts": {
5050
"test": [
51-
"phpunit --colors=always --coverage-text",
52-
"phpcs"
51+
"phpcs",
52+
"psalm",
53+
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
54+
],
55+
"build": [
56+
"phpdoc -d src/ -t phpdoc/",
57+
"XDEBUG_MODE=coverage phpunit --coverage-html coverage/"
5358
]
5459
}
5560
}

data/manufacturers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* List of all manufacturers
1616
*
17-
* @var array
17+
* @var array<string, string>
1818
*
1919
* @link https://en.wikipedia.org/wiki/Vehicle_identification_number#List_of_common_WMI
2020
* @link https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)#List_of_all_WMIs

data/regions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
/**
1515
* List of all regions
1616
*
17-
* @var array
17+
* @var array<string, array{
18+
* region: string,
19+
* countries: array<string, string>,
20+
* }>
1821
*
1922
* @link https://en.wikipedia.org/wiki/Vehicle_identification_number#Country_or_Region_codes
2023
* @link https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)#WMI_Regions

0 commit comments

Comments
 (0)