Style.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # NO CHECKED-IN PROTOBUF GENCODE
  4. # source: lily.proto
  5. namespace Palm\Lily\V1;
  6. use UnexpectedValueException;
  7. /**
  8. * https://owl.purdue.edu/owl/general_writing/general_writing_faqs.html
  9. *
  10. * Protobuf type <code>palm.lily.v1.Style</code>
  11. */
  12. class Style
  13. {
  14. /**
  15. * https://apastyle.apa.org/
  16. * https://owl.purdue.edu/owl/research_and_citation/apa_style/apa_formatting_and_style_guide/general_format.html
  17. * https://www.ilc.cuhk.edu.hk/Chinese/APAMLA/APA/APAlayout.aspx
  18. *
  19. * Generated from protobuf enum <code>APA_7 = 0;</code>
  20. */
  21. const APA_7 = 0;
  22. /**
  23. * https://www.mla.org/MLA-Style
  24. * https://owl.purdue.edu/owl/research_and_citation/mla_style/mla_formatting_and_style_guide/mla_formatting_and_style_guide.html#:~:text=MLA%20(Modern%20Language%20Association)%20style,the%20liberal%20arts%20and%20humanities.
  25. *
  26. * Generated from protobuf enum <code>MLA_8 = 10;</code>
  27. */
  28. const MLA_8 = 10;
  29. /**
  30. * https://www.chicagomanualofstyle.org/home.html
  31. * https://owl.purdue.edu/owl/research_and_citation/chicago_manual_17th_edition/cmos_formatting_and_style_guide/chicago_manual_of_style_17th_edition.html
  32. *
  33. * Generated from protobuf enum <code>CMOS = 20;</code>
  34. */
  35. const CMOS = 20;
  36. private static $valueToName = [
  37. self::APA_7 => 'APA_7',
  38. self::MLA_8 => 'MLA_8',
  39. self::CMOS => 'CMOS',
  40. ];
  41. public static function name($value)
  42. {
  43. if (!isset(self::$valueToName[$value])) {
  44. throw new UnexpectedValueException(sprintf(
  45. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  46. }
  47. return self::$valueToName[$value];
  48. }
  49. public static function value($name)
  50. {
  51. $const = __CLASS__ . '::' . strtoupper($name);
  52. if (!defined($const)) {
  53. throw new UnexpectedValueException(sprintf(
  54. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  55. }
  56. return constant($const);
  57. }
  58. }