Issues (33)

src/Geezify.js (4 issues)

1
const GeezConverter = require('./Converter/GeezConverter');
0 ignored issues
show
The constant GeezConverter seems to be never used. Consider removing it.
Loading history...
2
const AsciiConverter = require('./Converter/AsciiConverter');
0 ignored issues
show
The constant AsciiConverter seems to be never used. Consider removing it.
Loading history...
3
4
/**
5
 * Geezify converts numbers in ASCII to Geez and vise versa.
6
 *
7
 * @author Sam As End <4sam21{at}gmail.com>
8
 */
9
module.exports = class Geezify {
10
  /**
11
   * Geezify constructor.
12
   *
13
   * @param geezConverter
14
   * @param asciiConverter
15
   */
16
  constructor(geezConverter, asciiConverter) {
17
    this.geez_converter = geezConverter;
18
    this.ascii_converter = asciiConverter;
19
  }
20
21
  /**
22
   * Return a new Geezify instance.
23
   *
24
   * @return Geezify
25
   */
26
  static create() {
27
    return new Geezify(new GeezConverter(), new AsciiConverter());
0 ignored issues
show
The variable GeezConverter seems to be never declared. If this is a global, consider adding a /** global: GeezConverter */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
The variable AsciiConverter seems to be never declared. If this is a global, consider adding a /** global: AsciiConverter */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
28
  }
29
30
  /**
31
   * Converts ASCII number to geez.
32
   *
33
   * @param $ascii_number
34
   *
35
   * @throws \Geezify\Exception\NotAnIntegerArgumentException
36
   *
37
   * @return string
38
   */
39
  toGeez($ascii_number) {
40
    return this.geez_converter.convert($ascii_number);
41
  }
42
43
  /**
44
   * Convert geez to ASCII.
45
   *
46
   * @param string $geez_number
47
   *
48
   * @throws \Geezify\Exception\NotGeezArgumentException
49
   *
50
   * @return int
51
   */
52
  toAscii($geez_number) {
53
    return this.ascii_converter.convert($geez_number);
54
  }
55
56
  /**
57
   * @return GeezConverter
58
   */
59
  getGeezConverter() {
60
    return this.geez_converter;
61
  }
62
63
  /**
64
   * @param GeezConverter $geez_converter
65
   */
66
  setGeezConverter($geez_converter) {
67
    this.geez_converter = $geez_converter;
68
  }
69
70
  /**
71
   * @return AsciiConverter
72
   */
73
  getAsciiConverter() {
74
    return this.ascii_converter;
75
  }
76
77
  /**
78
   * @param AsciiConverter $ascii_converter
79
   */
80
  setAsciiConverter($ascii_converter) {
81
    this.ascii_converter = $ascii_converter;
82
  }
83
};
84