~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Validation/Rules/Latitude.php

  • Committer: Dan Garner
  • Date: 2016-02-04 14:13:07 UTC
  • mto: (454.4.101)
  • mto: This revision was merged to the branch mainline in revision 483.
  • Revision ID: git-v1:f9078f575b16a62a51e2f3d7bc15581058fb0747
Problem with DataSet form putting a 0 in library image references (should be empty)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2016 Spring Signage Ltd
5
 
 * (Latitude.php)
6
 
 */
7
 
 
8
 
 
9
 
namespace Xibo\Validation\Rules;
10
 
 
11
 
 
12
 
use Respect\Validation\Rules\AbstractRule;
13
 
 
14
 
/**
15
 
 * Class Latitude
16
 
 * @package Xibo\Validation\Rules
17
 
 */
18
 
class Latitude extends AbstractRule
19
 
{
20
 
    /** @inheritdoc */
21
 
    public function validate($input)
22
 
    {
23
 
        if (!is_numeric($input))
24
 
            return false;
25
 
 
26
 
        $latitude = doubleval($input);
27
 
 
28
 
        return ($latitude >= -90 && $latitude <= 90);
29
 
    }
30
 
}
 
 
b'\\ No newline at end of file'