Skip to content

Commit

Permalink
Change to static the validate_nif method
Browse files Browse the repository at this point in the history
  • Loading branch information
alphp committed May 3, 2021
1 parent e1cc222 commit dce47b4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[![GitHub license](https://img.shields.io/github/license/fawno/AEAT.svg)](https://github.com/fawno/AEAT/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/fawno/AEAT.svg)](https://github.com/fawno/AEAT/releases)
[![Packagist](https://img.shields.io/packagist/v/fawno/AEAT.svg)](https://packagist.org/packages/fawno/aeat)
[![GitHub license](https://img.shields.io/github/license/fawno/AEAT)](https://github.com/fawno/AEAT/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/fawno/AEAT)](https://github.com/fawno/AEAT/releases)
[![Packagist](https://img.shields.io/packagist/v/fawno/AEAT)](https://packagist.org/packages/fawno/aeat)
[![Packagist Downloads](https://img.shields.io/packagist/dt/fawno/AEAT)](https://packagist.org/packages/fawno/aeat/stats)
[![Documentation](https://img.shields.io/badge/manual-wsdlVNif-blue.svg)](docs/wsdlVNif.md)
[![GitHub issues](https://img.shields.io/github/issues/fawno/AEAT)](https://github.com/fawno/AEAT/issues)
[![GitHub forks](https://img.shields.io/github/forks/fawno/AEAT)](https://github.com/fawno/AEAT/network)
[![GitHub stars](https://img.shields.io/github/stars/fawno/AEAT)](https://github.com/fawno/AEAT/stargazers)
[![Documentation](https://img.shields.io/badge/manual-wsdlVNif-blue)](docs/wsdlVNif.md)

# AEAT
Clases para los servicios web de la [AEAT](http://www.agenciatributaria.es/)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fawno/aeat",
"version": "1.0.2",
"version": "1.0.3",
"description": "Clases para los servicios web de la AEAT",
"license": "MIT",
"authors": [
Expand Down
6 changes: 3 additions & 3 deletions src/wsdlVNif.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct ($local_cert, $passphrase, $options = [], $ssl_verif
protected function stream_context ($ssl_verifypeer = true, $options = []) {
$options['http']['user_agent'] = 'PHPSoapClient';
$options['ssl']['ciphers'] = 'DEFAULT@SECLEVEL=1';

if (!$ssl_verifypeer) {
$options['ssl']['verify_peer'] = false;
$options['ssl']['verify_peer_name'] = false;
Expand All @@ -51,8 +51,8 @@ public function VNif ($contribuyentes) {
public function VNifV2 ($contribuyentes) {
return $this->__soapCall('VNifV2', [['Contribuyente' => $contribuyentes]]);
}
public function nif_validation ($nif) {

public static function nif_validation ($nif) {
if (preg_match('~(ES)?([\w\d]{9})~', strtoupper($nif), $parts)) {
$nif = end($parts);
if (preg_match('~(^[XYZ\d]\d{7})([TRWAGMYFPDXBNJZSQVHLCKE]$)~', $nif, $parts)) {
Expand Down

0 comments on commit dce47b4

Please sign in to comment.