Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove Validate_LU

  • Loading branch information...
commit 0e345af35dcab9010a942208acc7600bb86770ad 1 parent 255112d
@CloCkWeRX CloCkWeRX authored
View
56 Validate/LU.php
@@ -1,56 +0,0 @@
-<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4: */
-/**
- * Methods for validation in Luxembourg
- *
- * PHP Version 5
- *
- * This source file is subject to the New BSD license, That is bundled
- * with this package in the file LICENSE, and is available through
- * the world-wide-web at
- * http://www.opensource.org/licenses/bsd-license.php
- * If you did not receive a copy of the new BSDlicense and are unable
- * to obtain it through the world-wide-web, please send a note to
- * pajoye@php.net so we can mail you a copy immediately.
- *
- * @category Validate
- * @package Validate_LU
- * @author Christian Weiske <cweiske@php.net>
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version SVN: $Id: DE.php 242590 2007-09-16 17:35:37Z kguest $
- * @link http://pear.php.net/package/Validate_DE
- */
-
-/**
- * Data validation class for Luxembourg
- *
- * This class provides methods to validate:
- * - Postal code
- *
- * @category Validate
- * @package Validate_LU
- * @author Christian Weiske <cweiske@php.net>
- * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: @package_version@
- * @link http://pear.php.net/package/Validate_DE
- */
-class Validate_LU
-{
- /**
- * Validate a luxembourgish postcode.
- *
- * @param string $postcode postcode to validate
- * @param bool $strong optional; strong checks (e.g. against a list of
- * postcodes) (not implemented)
- *
- * @return bool true if postcode is ok, false otherwise
- *
- * http://en.wikipedia.org/wiki/Postal_code
- */
- public static function postalCode($postcode, $strong = false)
- {
- return (bool)preg_match('/^[0-9]{4}$/', $postcode);
- }
-
-}
-?>
View
81 package_LU.xml
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.6.1"
- version="2.0"
- xmlns="http://pear.php.net/dtd/package-2.0"
- xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"
->
- <name>Validate_LU</name>
- <channel>pear.php.net</channel>
- <summary>Validation class for Luxembourg</summary>
- <description>Package containes locale validation for Luxembourg such as:
- * Postal Code
- </description>
-
- <lead>
- <name>Christian Weiske</name>
- <user>cweiske</user>
- <email>cweiske@php.net</email>
- <active>yes</active>
- </lead>
-
- <date>2010-08-04</date>
-
- <version>
- <release>0.1.0</release>
- <api>0.1.0</api>
- </version>
-
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
-
- <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD</license>
-
- <notes>
- - First version with postal code validation
- </notes>
- <contents>
- <dir name="/">
- <file name="Validate/LU.php" role="php">
- <tasks:replace from="@package_version@" to="version" type="package-info" />
- </file>
- <file name="tests/validate_LU_postalcodes.phpt" role="test" />
- </dir>
- </contents>
-
- <dependencies>
- <required>
- <php>
- <min>5.2.0</min>
- </php>
- <pearinstaller>
- <min>1.8.0</min>
- </pearinstaller>
- </required>
- </dependencies>
-
- <phprelease />
-
- <changelog>
-
- <release>
- <version>
- <release>0.1.0</release>
- <api>0.1.0</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2010-08-04</date>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD</license>
- <notes>
- - Initial release
- </notes>
- </release>
-
- </changelog>
-</package>
View
37 tests/validate_LU_postalcodes.phpt
@@ -1,37 +0,0 @@
---TEST--
-Test luxembourgish postal codes
---FILE--
-<?php
-$noYes = array('NO', 'YES');
-if (is_file(dirname(__FILE__) . '/../Validate/LU.php')) {
- require_once dirname(__FILE__) . '/../Validate/LU.php';
-} else {
- require_once 'Validate/LU.php';
-}
-
-
-$postalCodes = array(
- 1234,//ok
- 9238,//ok
- 'a123',//no
- '923Z',//no
- 123,//no
- 12,//no
- 1,//no
-);
-
-foreach ($postalCodes as $postalCode) {
- echo "{$postalCode}: "
- . $noYes[
- Validate_LU::postalCode($postalCode)
- ] . "\n";
-}
-
---EXPECT--
-1234: YES
-9238: YES
-a123: NO
-923Z: NO
-123: NO
-12: NO
-1: NO
Please sign in to comment.
Something went wrong with that request. Please try again.